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

# Create Location

> Create a new location. Must specify organization using query parameter or body parameter.




## OpenAPI

````yaml /openapi.yaml post /locations
openapi: 3.0.0
info:
  title: Answering Agent API
  description: API for Answering Agent platform
  version: 1.0.0
servers:
  - url: https://answeringagent.com/api/v1
    description: Production API
  - url: https://playground.answeringagent.com/api/v1
    description: Playground API
security: []
paths:
  /locations:
    post:
      tags:
        - Locations
      summary: Create Location
      description: >
        Create a new location. Must specify organization using query parameter
        or body parameter.
      operationId: createLocation
      parameters:
        - in: query
          name: organization_id
          schema:
            type: integer
          description: Organization to add the location to
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Name of the location
                address:
                  type: string
                  nullable: true
                  description: Physical address of the location
                area_code:
                  type: string
                  nullable: true
                  description: Optional area code hint for phone provisioning
                  pattern: ^\d{3}$
                google_place_id:
                  type: string
                  nullable: true
                  description: Google Places ID for the location
                organization_id:
                  type: integer
                  description: Organization ID (alternative to query parameter)
                  nullable: true
                team_id:
                  type: integer
                  description: Team ID (alias for organization_id)
                  nullable: true
      responses:
        '201':
          description: Location created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  location:
                    $ref: '#/components/schemas/Location'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Organization not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Organization not found
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Location:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        phone_number:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - pending
            - active
        address:
          type: string
          nullable: true
        google_place_id:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: API key is required
                enum:
                  - API key is required
                  - Invalid credentials
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              errors:
                type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````