GET

Get Custom Attribute

Use this API to get back a single custom attribute from a OneLogin account.

Resource URL

https://<subdomain>.onelogin.com/api/2/users/custom_attributes/:id

Header Parameters

Authorization

required

string

Set to bearer:<access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Read Users, Manage users, Read All, or Manage All.

Resource Parameters

id

required

integer

Set to the id of the custom attribute that you want to return.

If you don't know the custom attribute's id, use the List Custom Attributes API call to return all custom attributes and their id values.

Sample Responses

{
    "shortname": "personalemail",
    "position": 1,
    "id": 87846,
    "name": "Personal Email"
}

Typically, this error means that your access token value is invalid.

{
    "message": "Unauthorized",
    "name": "UnauthorizedError",
    "statusCode": 401
}
{
    "message": "The resource with the given id could not be found",
    "name": "NotFoundError",
    "statusCode": 404
}

Postman Collection

Replace sample variables indicated by {{ }} with your actual values.

Run In Postman