Customer Profile REST API Reference


Use the Customer Profile REST API to get the latest customer contact information. The API returns the customer information from the active default Alexa profile, which might not represent the person speaking to Alexa. Before you can use this API, your skill must request customer contact information. For more details, see Request Customer Contact Information for Use in Your Skill.

API endpoint

Use one of the following API hosts, based on the region where the customer is located:

  • North America: https://api.amazonalexa.com
  • Europe: https://api.eu.amazonalexa.com
  • Far East: https://api.fe.amazon.com

You can find the API endpoint in the context.System.apiEndpoint retrieved from a request from Alexa, such as the LaunchRequest or IntentRequest.

Authentication

Each API request must have an authorization header whose value is the context.System.apiAccessToken retrieved from a request from Alexa, such as the LaunchRequest or IntentRequest. The apiAccessToken encapsulates the permissions granted to your skill.

To access customer contact information, the following permission scopes must be enabled for your skill and granted by the customer..

Permission scope Description

alexa::profile:name:read

Allows your skill to get the full name of the customer.

alexa::profile:given_name:read

Allows your skill to get the given first name of the customer.

alexa::profile:email:read

Allows your skill to get the email address of the customer.

alexa::profile:mobile_number:read

Allows your skill to get the mobile phone number of the customer.

Operations

The Customer Profile API includes the following operations.

Operation HTTP method and URI

Get email address

GET /v2/accounts/~current/settings/Profile.email

Get full name

GET /v2/accounts/~current/settings/Profile.name

Get given name

GET /v2/accounts/~current/settings/Profile.givenName

Get mobile number

GET /v2/accounts/~current/settings/Profile.mobileNumber

Get email address

Get the email address of the customer associated with the specified access token.

Request

To get the email address, you make a GET request to the /v2/accounts/~current/settings/Profile resource.

Request path and header example

Copied to clipboard.

GET /v2/accounts/~current/settings/Profile.email
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to request.context.System.apiAccessToken property value retrieved from a request from Alexa.

String

Yes

Request body example

The request has no body.

Request body properties

The request has no body.

Response

A successful response returns HTTP 200 OK, along with the email address of the customer. On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.

Response body example

{
    "email": "jsmith@example.com"
}

Response body properties

Property Description Type

email

Email address of the customer.
Valid value: alphanumeric characters and .+@[^@]+

String

HTTP status codes

Status Description

200 OK

Response body contains the email address of the customer.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.
The following example shows the response body with the error code and message.

{
     "message": "The property is outside the allowed range.",
     "code": "INVALID_STRING_LENGTH"
}

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. Retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Get full name

Get the full name of the customer associated with the specified access token.

Request

To get the customer name, you make a GET request to the /v2/accounts/~current/settings/Profile resource.

Request path and header example

Copied to clipboard.

GET /v2/accounts/~current/settings/Profile.name
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to request.context.System.apiAccessToken property value retrieved from a request from Alexa.

String

Yes

Request body example

The request has no body.

Request body properties

The request has no body.

Response

A successful response returns HTTP 200 OK, along with the customer name. On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.

Response body example

{
    "name": "John Smith"
}

Response body properties

Property Description Type

name

Full name of the customer.

String

HTTP status codes

Status Description

200 OK

Response body contains the full name of the customer.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.
The following example shows the response body with the error code and message.

{
     "message": "The property is outside the allowed range.",
     "code": "INVALID_STRING_LENGTH"
}

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. Retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Get given name

Get the given first name of the customer associated with the specified access token.

Request

To get the given name, you make a GET request to the /v2/accounts/~current/settings/Profile resource.

Request path and header example

Copied to clipboard.

GET /v2/accounts/~current/settings/Profile.givenName
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to request.context.System.apiAccessToken property value retrieved from a request from Alexa.

String

Yes

Request body example

The request has no body.

Request body properties

The request has no body.

Response

A successful response returns HTTP 200 OK, along with the given first name of the customer. On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.

Response body example

{
    "name": "John"
}

Response body properties

Property Description Type

name

Given first name of the customer.

String

HTTP status codes

Status Description

200 OK

Response body contains the first name of the customer.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.
The following example shows the response body with the error code and message.

{
     "message": "The property is outside the allowed range.",
     "code": "INVALID_STRING_LENGTH"
}

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. Retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.

Get mobile number

Get the mobile number of the customer associated with the specified access token.

This operation returns the country code and phone number. The phone number might contain the country code, and by itself, the phone number value is a valid number for dialing.

Example phone number values: +917799827710, 7799827710, +91 7799 82 77 11, +91 7799-82-77-11. Example country code values: +1, 001, 1.

Request

To get the mobile number, you make a GET request to the /v2/accounts/~current/settings/Profile resource.

Request path and header example

Copied to clipboard.

GET /v2/accounts/~current/settings/Profile.mobileNumber
Host: api.amazonalexa.com
Content-Type: application/json
Authorization: Bearer {access token}
Accept: application/json

Request path and header parameters

Parameter Located in Description Type Required

access token

Header

Access token for the customer.
Set to request.context.System.apiAccessToken property value retrieved from a request from Alexa.

String

Yes

Request body example

The request has no body.

Request body properties

The request has no body.

Response

A successful response returns HTTP 200 OK, along with the given mobile number of the customer. On error, the response returns the appropriate HTTP status code and includes a response body with an error code and human readable message.

Response body example

{
    "countryCode": "+91",
    "phoneNumber": "7799-82-77-11"
}

Response body properties

Property Description Type

countryCode

Specifies the country code of the mobile number.
Valid length: 1–10 characters

String

phoneNumber

Specifies the mobile number.
Valid length: 1–20 characters

String

HTTP status codes

Status Description

200 OK

Response body contains the mobile number of the customer.

400 Bad Request

Indicates that one or more properties in the request body aren't valid.
The following example shows the response body with the error code and message.

{
     "message": "The property is outside the allowed range.",
     "code": "INVALID_STRING_LENGTH"
}

401 Unauthorized

Request didn't include the authorization token, or the included token expired or isn't valid. Or, you don't have access to the resource.

403 Forbidden

Indicates that the authorization token is valid, but the requested operation isn't allowed.

404 Not Found

Requested resource not found.

429 Too Many Requests

Permitted rate limit, specified as number of requests per unit of time, exceeded. Retry the request by using exponential back-off.

500 Server Error

Error occurred on the server. Retry the request by using exponential back-off.

503 Service Unavailable

Server is down for maintenance, overloaded, or otherwise unavailable to handle the incoming request.


Was this page helpful?

Last updated: Aug 01, 2024