Account API
POST Create Key
Create a new API key for your account. The key is immediately provisioned and returned with an APPROVED status.
Resource URL
Resource Information
| Response Formats | JSON |
| Authentication | Yes (Requires Key) |
| Rate Limited | Yes |
Request Parameters
| Request Parameter | Description | Required |
|---|---|---|
| key | The API Key, which is needed to make requests to MapQuest services. | Yes |
Request Body
The request body must be JSON (Content-Type: application/json).
| Field | Type | Description | Required |
|---|---|---|---|
| name | string | A display name for the new key. Must be at least 1 character and unique across your existing keys. | Yes |
Response Object
Returned with HTTP status 201 Created.
| Field | Type | Description |
|---|---|---|
| key | object | The newly created key object. |
| key.name | string | The display name provided in the request. |
| key.key | string | The API key value used to authenticate requests. |
| key.status | string | The status of the key. Always "APPROVED" on creation. |
Error Responses
Errors are returned as application/problem+json. Refer to the status codes page for more details.
| Status | Description |
|---|---|
| 400 | Validation error. The request body is missing or the name field is empty. |
| 401 | Missing or invalid consumer identity. The request could not be authenticated. |
| 404 | Consumer not found. No account matches the authenticated identity. |
| 409 | A key with the provided name already exists on this account. |
| 500 | An internal error occurred. Please retry. |
Example Request
json
{
"name": "my-new-app"
}Example Response
json
{
"key": {
"name": "my-new-app",
"key": "IL1deIyHyQA40WpeLeA1bIUXuvTwlGjo",
"status": "APPROVED"
}
}json
{
"status": 409,
"title": "Conflict",
"detail": "A key with the name 'my-new-app' already exists"
}