Skip to content

Create extension

Request to add an extension to the pool:

POST /api/v2/extensions.json

The request body contains the extension value and, in multi-tenant deployments, the tenant_id. When tenant_id is omitted, the extension is created in the tenant of the API user.

For example:

{
    "extension": {
        "extension": "12005040978",
        "tenant_id": "209e8a10-e250-4824-8567-43f48e07a060"
    }
}

Response contains HTTP status code as shown in the following table.

Response Description
201 Created

The extension has been successfully created. The Location header and the response body contain the URL of the new extension:

HTTP/1.1 201 Created
Location: /api/v2/extensions/e011c408-f288-11e4-9b73-e03f497dbdff.json

{"url": "/api/v2/extensions/e011c408-f288-11e4-9b73-e03f497dbdff.json"} | | 400 Bad Request |

The request cannot be completed because the supplied JSON object has invalid data, for example the extension exists already.

The response contains a detailed description of the error, like:

{"error": "InvalidRecord", "explanation": "Record Validation errors", "details": {"extension": "Such extension already exists; Such extension is already assigned to tenant \"Acme\""}}
| | 403 Forbidden | The request cannot be completed because API user has no permission to create extensions |