On this page

MyAccount API v1 (Deprecated)

Note: This version of the MyAccount API is deprecated. For the latest version of the API, see the reference documentation (opens new window).

Deprecated

The Okta MyAccount API allows end users (with or without administrator access) to fetch and update their own Okta user profiles. It implements a subset of the existing Users API (opens new window) but with significant differences. This API doesn't expose information that a user shouldn't have access to, and it doesn't support lifecycle operations.

All operations in this API implicitly refer to the user making the API call. No user ID is needed (or even accepted).

MyAccount Operations

The MyAccount API has the following operations:

Get Me

GET /api/v1/myaccount

Fetches the current user's Me object, a collection of links to information describing the user.

Request path parameters

N/A

Request query parameters

N/A

Response body

The requested Me object

Usage example

Any user with a valid session can issue this request to get basic information about their account.

Request
curl -v -X GET \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/myaccount"
Response
{
    "_links": {
        "directoryProfile": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount/directoryProfile"
        },
        "self": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount"
        }
    },
    "createdAt": "2020-01-14T20:05:32.000Z",
    "id": "00u21l3rOYRXX1tnI0g4",
    "modifiedAt": "2020-10-13T03:17:09.000Z"
}

Get My User Profile Schema

GET /api/v1/myaccount/profile/schema

Fetches the appropriate user profile schema for the caller's user type (opens new window).

Note: If a property's value is not visible to an end user (because it is hidden or sensitive (opens new window) then the property's definition will also be hidden in the output of this API.

Request path parameters

N/A

Request query parameters

N/A

Response body

The User Profile Schema for the caller.

Usage example

Any user with a valid session can issue this request to get the Schema for their User Profile.

Request
curl -v -X GET \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/myaccount/profile/schema"
Response
{
    "_links": {
        "self": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount/profile/schema"
        },
        "user": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount"
        }
    },
    "properties": {
        "customBoolean": {
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "customBoolean",
            "type": "boolean"
        },
        "foo": {
            "permissions": {
                "SELF": "READ_ONLY"
            },
            "title": "foo",
            "type": "string"
        },
        "login": {
            "maxLength": 100,
            "minLength": 5,
            "permissions": {
                "SELF": "READ_ONLY"
            },
            "required": true,
            "title": "Username",
            "type": "string"
        },
        "mobilePhone": {
            "maxLength": 100,
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "Mobile phone",
            "type": "string"
        },
        "customInteger": {
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "customInteger",
            "type": "integer"
        }
    }
}

Get My User Profile

GET /api/v1/myaccount/directoryProfile

Fetches the caller's Okta User Profile, excluding any attribute also excluded by Get My User Profile Schema

Request query parameters

Parameter Type Description
expand String (Optional) If specified as schema, the User Profile Schema is included in the embedded attribute.

Response body

Returns a User Profile.

Usage example

Any user with a valid session can issue this request to get their User Profile.

Request

This request would retriever the requesting User's Profile.

curl -v -X GET \
-H "Authorization: SSWS ${api_token}" \
"https://${yourOktaDomain}/api/v1/myaccount/directoryProfile"
Response
{
    "_links": {
      "describedBy": {
        "href": "https://{yourOktaDomain}/api/v1/myaccount/profile/schema",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "self": {
        "href": "https://{yourOktaDomain}/api/v1/myaccount/profile",
        "hints": {
          "allow": [
            "GET",
            "PUT"
          ]
        }
      }
    },
    "createdAt": "2020-01-14T20:05:32.000Z",
    "modifiedAt": "2020-10-13T03:17:09.000Z",
    "profile": {
        "customBoolean": null,
        "foo": "bar",
        "login": "example@ex.ample.com",
        "mobilePhone": null,
        "customInteger": null
    }
}

Update My User Profile

PUT /api/v1/myaccount/directoryProfile

Updates the caller's User Profile.

Note: This API differs from the the existing Users API (opens new window) in that only PUT is supported. This API also doesn't support a partial update. All values returned from fetching the User Profile must be passed to this API, or the update won't pass validation. This applies even if the omitted schema property is optional. To unset an optional property, explicitly pass the property with a value of null.

Request path parameters

N/A

Request query parameters

N/A

Request body

This API requires the profile property of a User Profile as its request body.

Property Type Description
profile Object The properties defined in the schema

Response body

Returns the result of applying the update, as if the caller had invoked the GET User Profile operation.

Usage example

Request

This request would update the user profile of the caller to have exactly the values specified.

curl -XPUT 'https://${yourOktaDomain}/api/v1/myaccount/directoryProfile' -H 'Authorization: SSWS {token}' -H 'Content-Type: application/json' --data '{
     "profile": {
         "customBoolean": false,
         "foo": "bar",
         "login": "dayton.williams@okta.com",
         "notFive": 5,
         "customInteger": null
     }
 }'
Response
{
    "_links": {
      "describedBy": {
        "href": "https://{yourOktaDomain}/api/v1/myaccount/profile/schema",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "self": {
        "href": "https://{yourOktaDomain}/api/v1/myaccount/profile",
        "hints": {
          "allow": [
            "GET",
            "PUT"
          ]
        }
      }
    },
    "createdAt": "2020-01-14T20:05:32.000Z",
    "modifiedAt": "2020-11-03T06:01:13.000Z",
    "profile": {
        "customBoolean": false,
        "foo": "bar",
        "login": "example@ex.ample.com",
        "mobilePhone": null,
        "customInteger": 5
    }
}

MyAccount API objects

Me object

Me properties

The Me object has several properties:

Property Type Description
_links Object (JSON HAL (opens new window)) Discoverable resources related to the caller's account
createdAt String (ISO-8601) The timestamp the caller's account was created
id String The caller's user ID
modifiedAt String (ISO-8601) The timestamp the caller's account was last updated

Me example

{
    "_links": {
        "directoryProfile": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount/directoryProfile"
        },
        "self": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount"
        }
    },
    "createdAt": "2020-01-14T20:05:32.000Z",
    "id": "00u21l3rOYRXX1tnI0g4",
    "modifiedAt": "2020-10-13T03:17:09.000Z"
}

User Profile Schema object

User Profile Schema properties

The User Profile Schema object has several properties:

Property Type Description
_links Object (JSON HAL (opens new window)) Discoverable resources related to the caller's User Profile Schema
properties Object The properties defined in the User Profile Schema (opens new window)

User Profile Schema example

{
    "_links": {
      "self": {
        "href": "https://{yourOktaDomain}/api/v1/myaccount/profile/schema",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      }
    },
    "properties": {
        "customBoolean": {
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "customBoolean",
            "type": "boolean"
        },
        "foo": {
            "permissions": {
                "SELF": "READ_ONLY"
            },
            "title": "foo",
            "type": "string"
        },
        "login": {
            "maxLength": 100,
            "minLength": 5,
            "permissions": {
                "SELF": "READ_ONLY"
            },
            "required": true,
            "title": "Username",
            "type": "string"
        },
        "mobilePhone": {
            "maxLength": 100,
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "Mobile phone",
            "type": "string"
        },
        "customInteger": {
            "permissions": {
                "SELF": "READ_WRITE"
            },
            "title": "customInteger",
            "type": "integer"
        }
    }
}

User Profile object

User Profile properties

The User Profile object has several properties:

Property Type Description
_embedded Object If expand=schema is included in the request, the User Profile Schema will be included in the response.
_links Object (JSON HAL (opens new window)) Discoverable resources related to the caller's user profile schema
createdAt String (ISO-8601) The timestamp the caller's account was created
modifiedAt String (ISO-8601) The timestamp the caller's account was last updated
profile Object The properties defined in the User Profile Schema

User Profile example

{
    "_links": {
        "describedBy": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount/profile/schema"
        },
        "self": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount/directoryProfile"
        },
        "user": {
            "href": "https://{yourOktaDomain}/api/v1/myaccount"
        }
    },
    "createdAt": "2020-01-14T20:05:32.000Z",
    "modifiedAt": "2020-10-13T03:17:09.000Z",
    "profile": {
        "customBoolean": null,
        "foo": "bar",
        "login": "example@ex.ample.com",
        "mobilePhone": null,
        "customInteger": null
    }
}