> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.sesametime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assign a location to an entity

> Assigns a location of the authenticated company to an office, department or entity group of the same company. Checks run in this order: request validation (422), target entity existence and ownership (404 `location_assignment_target_not_found`), location existence and ownership (404 `location_not_found`), duplicate (409). Assigning a second location to an office does not change the geofence exposed by `GET /core/v3/offices/{id}`, which keeps reading the oldest assignation.



## OpenAPI

````yaml POST /core/v3/location-assignations
openapi: 3.0.0
info:
  description: ''
  version: 3.0.0
  title: Sesame Public API
servers:
  - url: https://api-{region}.sesametime.com
    variables:
      region:
        default: eu1
security: []
tags: []
paths:
  /core/v3/location-assignations:
    post:
      tags:
        - Location Assignations
      summary: Assign a location to an entity
      description: >-
        Assigns a location of the authenticated company to an office, department
        or entity group of the same company. Checks run in this order: request
        validation (422), target entity existence and ownership (404
        `location_assignment_target_not_found`), location existence and
        ownership (404 `location_not_found`), duplicate (409). Assigning a
        second location to an office does not change the geofence exposed by
        `GET /core/v3/offices/{id}`, which keeps reading the oldest assignation.
      operationId: AssignLocationToEntity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - locationId
                - entityReference
              properties:
                locationId:
                  type: string
                  format: uuid
                entityReference:
                  type: object
                  required:
                    - type
                    - id
                  properties:
                    type:
                      type: string
                      enum:
                        - office
                        - department
                        - entity_group
                      example: office
                    id:
                      type: string
                      format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    description: >-
                      An assignation of a location of the authenticated company
                      to an office, department or entity group.
                    properties:
                      id:
                        type: string
                        format: uuid
                      locationId:
                        type: string
                        format: uuid
                      entityReference:
                        type: object
                        required:
                          - type
                          - id
                        properties:
                          type:
                            type: string
                            enum:
                              - office
                              - department
                              - entity_group
                            example: office
                          id:
                            type: string
                            format: uuid
                  meta:
                    type: object
                    properties:
                      currentPage:
                        type: integer
                        example: 1
                      lastPage:
                        type: integer
                        example: 1
                      total:
                        type: integer
                        example: 1
                      perPage:
                        type: integer
                        example: 1
        '401':
          description: Unauthorized - Invalid or missing API Key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating authentication failure
                    example: Invalid or missing API Key
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: UNAUTHORIZED
              example:
                message: Invalid or missing API Key
                code: UNAUTHORIZED
        '404':
          description: >-
            Target entity not found in the company
            (`location_assignment_target_not_found`), location not found in the
            company (`location_not_found`), or the assignation was removed
            concurrently before it could be read back
            (`location_assignment_not_found`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      status:
                        type: integer
                        example: 404
                      message:
                        type: string
                        example: location_assignment_target_not_found
                      errors:
                        type: string
                        example: location_assignment_target_not_found
        '409':
          description: >-
            The location is already assigned to that entity
            (`location_already_assigned_to_entity`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      status:
                        type: integer
                        example: 409
                      message:
                        type: string
                        example: location_already_assigned_to_entity
                      errors:
                        type: string
                        example: location_already_assigned_to_entity
        '422':
          description: >-
            Validation error: missing `locationId` or `entityReference`,
            `entityReference.type` not one of `office`, `department`,
            `entity_group`, or an id that is not a UUID
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      status:
                        type: integer
                        example: 422
                      message:
                        type: string
                        example: Unprocessable entity
                      errors:
                        type: object
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message indicating rate limit exceeded
                    example: Rate limit exceeded. Please try again later.
                  code:
                    type: string
                    description: Error code for programmatic handling
                    example: RATE_LIMIT_EXCEEDED
                  retryAfter:
                    type: integer
                    description: Number of seconds to wait before retrying
                    example: 60
              example:
                message: Rate limit exceeded. Please try again later.
                code: RATE_LIMIT_EXCEEDED
                retryAfter: 60
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````