API Basics
Here is the basic information needed to get started on the User Profile GraphQL API.
Endpoints
All User Profile GraphQL API queries/mutations are under the following endpoints:
Modern APS Endpoint (Recommended):
POST https://api.aps.autodesk.com/unifieduserprofile
Legacy Endpoint (Still Supported):
POST https://developer.api.autodesk.com/unifieduserprofile
Note: We recommend using the modern APS endpoints for all new integrations. Both endpoints are functionally equivalent and will continue to be supported.
For detailed endpoint information including code examples in multiple languages, see POST /unifieduserprofile.
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Required | It is required for all the calls to User Profile API |
| x-correlation-id | Optional | This header can be used to uniquely identify the request on Profile team's side. |
| Content-Type | Required | Set value as application/json |
Requests
All GraphQL requests are HTTP POST requests. The request body is a JSON object with two components:
- query (required): The GraphQL query or mutation string, which includes the fields requested from the API
- variables (optional): An object containing values for variables used in the query
Note: The
variablescomponent must be passed as a JSON object, not as a JSON-encoded string.
API tools can fetch the GraphQL schema and provide autocomplete for field names while you construct your queries.
Queries
A query request body has the following structure:
{
"query": "
query GetUserProfile($filter: UserProfileInput!) {
userProfile(filter: $filter) {
userId
personalInfo {
primaryEmail
basicInfo {
firstName
lastName
}
}
}
}
",
"variables": {
"filter": {
"id": "<USER_ID>"
}
}
}
Note: The query string above is shown with line breaks for readability. In actual JSON, use
\nescape sequences or your programming language’s multi-line string syntax.
For reference, here are the query and variables portions separately:
Query:
query GetUserProfile($filter: UserProfileInput!) {
userProfile(filter: $filter) {
userId
personalInfo {
primaryEmail
basicInfo {
firstName
lastName
}
}
}
}
Variables:
{
"filter": {
"id": "<USER_ID>"
}
}
query GetUserProfile($filter: UserProfileInput!): GetUserProfile is the optional operation name given by the client. As per GraphQL standards, operation names, fields, and arguments should use camelCase.
userProfile(filter: $filter): userProfile is the root query field as defined in the GraphQL schema. $filter is an input object argument passed to this field.
filter.id: Input field that is part of the $filter input object.
userId, personalInfo, basicInfo, firstName, lastName: Fields that are part of the response object. An error is thrown if an invalid field is requested.
While providing an operation name is optional, it is strongly recommended for debugging and logging purposes.
Mutations
A mutation request body has the following structure:
{
"query": "
mutation UpdateUserProfile($input: UpdateUserProfileInput!) {
updateUserProfileV2(input: $input) {
userId
personalInfo {
basicInfo {
firstName
}
professionalInfo {
aboutMe
}
}
}
}
",
"variables": {
"input": {
"id": "<USER_ID>",
"firstName": "UpdatedFirstName",
"professionalInfo": {
"aboutMe": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}
}
}
}
For reference, here are the query and variables portions separately:
Mutation:
mutation UpdateUserProfile($input: UpdateUserProfileInput!) {
updateUserProfileV2(input: $input) {
userId
personalInfo {
basicInfo {
firstName
}
professionalInfo {
aboutMe
}
}
}
}
Variables:
{
"input": {
"id": "<USER_ID>",
"firstName": "UpdatedFirstName",
"professionalInfo": {
"aboutMe": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}
}
}
mutation UpdateUserProfile($input: UpdateUserProfileInput!): UpdateUserProfile is the optional operation name given by the client.
updateUserProfileV2(input: $input): updateUserProfileV2 is the mutation field as defined in the GraphQL schema. $input is an input object argument passed to this field.
input.id, input.firstName, input.professionalInfo.aboutMe: Input fields that are part of the $input input object.
userId, basicInfo.firstName, professionalInfo.aboutMe: Fields that are part of the response object. An error is thrown if an invalid field is requested.
Response
Successful responses for both queries and mutations follow the same JSON structure:
{
"data": {
"userProfile": {
"userId": "testId",
"personalInfo": {
"basicInfo": {
"firstName": "test"
},
"professionalInfo": {
"aboutMe": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}
}
}
}
}
Only the requested fields are returned in the response.
Errors
All GraphQL error responses return a 200 OK HTTP status code, even if these responses contain errors. Moreover, errors in nested queries don’t have to fail the whole query, allowing for “partial responses”.
For more information, see:
- GraphQL Error Handling - Understanding error responses and partial success
- Error Codes Reference - Complete list of error codes