Skip to main content
Version: Next

Create Location

This method is used to create a location object within the specified domain.

note

The location name must be unique within a domain.

Request Parameters

POST /api/clients/v1/locations/

Headers

  • Content-Type: application/json
  • Authorization: Bearer $access_token

JSON body

ParameterTypeConstraintsDescriptionExample
namestringRequiredLocation name/images
typestringmatching | namedLocation type. Default is matchingmatching
domain_idinteger> 0. RequiredDomain ID1
headersobject[]< 10List of additional HTTP headers
headers.keystring< 1024Header nameX-MEDIA-TYPE
headers.valuestring< 32768Header value.pptx
cors_headersobject{}CORS headers object
cors_headers.access_control_allow_originobject[string]< 50Allowed origins["example.com"]
cors_headers.access_control_expose_headersobject[string]< 50Headers exposed to the browser["X-MEDIA-TYPE"]
cors_headers.access_control_max_ageinteger< 86400How long results can be cached (seconds)600
cors_headers.access_control_allow_credentialsbooleanWhether credentials are allowedtrue
cors_headers.access_control_allow_methodsobject[string]OPTIONS | GET | HEAD | PUT | PATCH | POST | DELETEAllowed HTTP methods["OPTIONS"]
cors_headers.access_control_allow_headersobject[string]< 50Allowed request headers[*]

Response Parameters

JSON body

ParameterTypeDescription
idintegerLocation ID
namestringLocation name
typestringLocation type
domain_idintegerDomain ID
headersobject[]List of additional HTTP headers
headers.keystringHeader name
headers.valuestringHeader value
cors_headersobject{}CORS headers object
cors_headers.access_control_allow_originobject[string]Allowed origins
cors_headers.access_control_expose_headersobject[string]Exposed headers
cors_headers.access_control_max_ageintegerCache duration for preflight response
cors_headers.access_control_allow_credentialsbooleanWhether credentials are allowed
cors_headers.access_control_allow_methodsobject[string]Allowed HTTP methods
cors_headers.access_control_allow_headersobject[string]Allowed request headers
201 Created

Location object

{
"id": 1,
"name": "/images",
"type": "matching",
"domain_id": 1,
"headers": [
{
"key": "X-MEDIA-TYPE",
"value": ".pptx"
}
],
"cors_headers": {
"access_control_allow_origin": [
"*"
],
"access_control_expose_headers": [
"*"
],
"access_control_max_age": 600,
"access_control_allow_credentials": true,
"access_control_allow_methods": [
"OPTIONS"
],
"access_control_allow_headers": [
"X-MEDIA-TYPE"
]
}
}
400 Bad Request

Invalid or missing required body parameters

    {
"domain_id": [
"Domain with ID {domain_id} not found"
],
"name": [
"Invalid location name"
],
"headers": [
"Invalid header key"
]
}
401 Unauthorized

Authentication credentials are missing or invalid

{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden

Location can only be linked to a domain of your own project

{
"detail": "Only participants can view this project's locations"
}
409 Conflict

A location with these parameters already exists

{
"detail": "Location already exists"
}