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

# Create Location

> Create a new address/location with geographic coordinates and associate it with people, companies, or workspaces.



## OpenAPI

````yaml POST /v1/locations
openapi: 3.1.0
info:
  title: Well Document API
  version: 1.0.0
  description: API for uploading and managing financial documents in the Well platform
servers:
  - url: https://api.wellapp.ai
security: []
paths:
  /v1/locations:
    post:
      summary: Create location
      description: >-
        Create a new address/location with geographic coordinates and associate
        it with people, companies, or workspaces.
      parameters:
        - $ref: '#/components/parameters/AuthorizationHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationCreateRequest'
            example:
              type: location
              attributes:
                address_line1: 123 Turing Way
                address_line2: ''
                city: London
                region: Greater London
                postal_code: E1 6AN
                country: GB
                latitude: 37.7749
                longitude: -122.4194
                is_primary: true
                is_registered: true
              relationships:
                persons:
                  data:
                    - type: people
                      id: people1
                companies:
                  data:
                    - type: company
                      id: company_tenant
                workspaces:
                  data:
                    - type: workspace
                      id: workspace_tenant
      responses:
        '201':
          description: Location created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationCreateResponse'
              example:
                data:
                  type: location
                  id: loc1
                  attributes:
                    full_address: 123 Turing Way, London, Greater London, E1 6AN, GB
                    address_line1: 123 Turing Way
                    address_line2: ''
                    city: London
                    region: Greater London
                    postal_code: E1 6AN
                    country: GB
                    latitude: 37.7749
                    longitude: -122.4194
                    is_primary: true
                    is_registered: true
                    created_at: '2025-06-01T10:00:00Z'
                    updated_at: '2025-06-01T10:00:00Z'
                  relationships:
                    persons:
                      data:
                        - type: people
                          id: people1
                    companies:
                      data:
                        - type: company
                          id: company_tenant
                    workspaces:
                      data:
                        - type: workspace
                          id: workspace_tenant
                included:
                  - type: people
                    id: people1
                    attributes:
                      first_name: Alan
                      last_name: Turing
                      full_name: Alan Turing
                      created_at: '2025-06-01T09:00:00Z'
                      updated_at: '2025-06-01T09:00:00Z'
                  - type: company
                    id: company_tenant
                    attributes:
                      name: Tech Innovations Ltd
                      description: Leading technology research company
                      locale: en
                      domain_name_primary_link_url: techinnovations.com
                      tax_id:
                        value: GB123456789
                        type: VAT
                      registration:
                        trade_name: Tech Innovations
                        registered_name: Tech Innovations Limited
                      registration_number:
                        business_type: Ltd
                        value: '12345678'
                        registry_name: Companies House
                        registry_country: GB
                      created_at: '2025-05-15T08:00:00Z'
                      updated_at: '2025-05-15T08:00:00Z'
                  - type: workspace
                    id: workspace_tenant
                    attributes:
                      name: UK Operations Workspace
                      description: Workspace for UK-based operations and teams
                      avatar_color: '#2E86AB'
                      external_workspace_id: uk_ops_ws_001
                      auto_extract_enabled: true
                      created_at: '2025-05-20T10:00:00Z'
                      updated_at: '2025-05-20T10:00:00Z'
        '400':
          description: Bad request - invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      description: Bearer token for authentication
  schemas:
    LocationCreateRequest:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              const: location
            attributes:
              $ref: '#/components/schemas/LocationCreateAttributes'
            relationships:
              $ref: '#/components/schemas/SimpleRelationships'
          required:
            - type
            - attributes
      required:
        - data
    LocationCreateResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              example: location
            id:
              type: string
              format: uuid
            attributes:
              $ref: '#/components/schemas/LocationAttributes'
            relationships:
              type: object
              properties:
                persons:
                  $ref: '#/components/schemas/PersonRelationship'
                companies:
                  $ref: '#/components/schemas/CompanyRelationship'
                workspaces:
                  $ref: '#/components/schemas/WorkspaceRelationship'
    BadRequestError:
      type: object
      properties:
        code:
          type: string
          example: SCHEMA_VALIDATION_ERROR
          description: Error code identifier
        status:
          type: integer
          example: 400
          description: HTTP status code
        title:
          type: string
          example: Validation Error
          description: Error title
        message:
          type: string
          example: The request is invalid
          description: Detailed error message
        details:
          type: array
          items:
            type: object
            properties:
              instancePath:
                type: string
                description: Path to the invalid field in the request
              schemaPath:
                type: string
                description: Path to the validation rule in the schema
              keyword:
                type: string
                description: Validation keyword that failed
              params:
                type: object
                description: Parameters related to the validation failure
              message:
                type: string
                description: Human-readable validation error message
          description: Array of detailed validation errors
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    UnauthorizedError:
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
          description: Error code identifier
        status:
          type: integer
          example: 401
          description: HTTP status code
        title:
          type: string
          example: Unauthorized
          description: Error title
        message:
          type: string
          example: You are not authorized to access this resource
          description: Detailed error message
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    LocationCreateAttributes:
      type: object
      properties:
        address_line1:
          type: string
          description: Primary address line
        address_line2:
          type: string
          description: Secondary address line (optional)
        city:
          type: string
          description: City name
        region:
          type: string
          description: State, province, or region
        postal_code:
          type: string
          description: Postal or ZIP code
        country:
          type: string
          description: Two-letter ISO country code (e.g., 'US', 'GB')
        latitude:
          type: number
          format: float
          description: Geographic latitude coordinate
        longitude:
          type: number
          format: float
          description: Geographic longitude coordinate
        is_primary:
          type: boolean
          description: Whether this is the primary location
          default: false
        is_registered:
          type: boolean
          description: Whether this is a registered business address
          default: false
        label:
          type: string
          enum:
            - work
            - personal
            - other
            - ...
          description: >-
            Email label type. See [all available labels](/enums/label) for
            complete list.
      required:
        - address_line1
        - country
    SimpleRelationships:
      type: object
      properties:
        persons:
          $ref: '#/components/schemas/PersonRelationRequest'
        companies:
          $ref: '#/components/schemas/CompanyRelationRequest'
        workspaces:
          $ref: '#/components/schemas/WorkspaceRelationRequest'
    LocationAttributes:
      type: object
      properties:
        full_address:
          type: string
          description: Complete formatted address
        address_line1:
          type: string
          description: Primary address line
        address_line2:
          type: string
          description: Secondary address line
        city:
          type: string
          description: City name
        region:
          type: string
          description: State, province, or region
        postal_code:
          type: string
          description: Postal or ZIP code
        country:
          type: string
          description: Two-letter ISO country code
        latitude:
          type: number
          format: float
          description: Geographic latitude coordinate
        longitude:
          type: number
          format: float
          description: Geographic longitude coordinate
        is_primary:
          type: boolean
          description: Whether this is the primary location
        is_registered:
          type: boolean
          description: Whether this is a registered business address
        label:
          type: string
          description: Custom label for the location
        created_at:
          type: string
          format: date-time
          description: Date and time when the location was created
        updated_at:
          type: string
          format: date-time
          description: Date and time when the location was last updated
    PersonRelationship:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/PersonRelationshipItem'
    CompanyRelationship:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CompanyRelationshipItem'
    WorkspaceRelationship:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceRelationshipItem'
    PersonRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - people
              id:
                type: string
                description: >-
                  UUID of an existing people or temp-id that references an
                  people defined in the included array
            required:
              - type
              - id
    CompanyRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - company
              id:
                type: string
                description: >-
                  UUID of an existing companies or temp-id that references an
                  companies defined in the included array
            required:
              - type
              - id
    WorkspaceRelationRequest:
      type: object
      properties:
        data:
          type: array
          items:
            oneOf:
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  external_workspace_id:
                    type: string
                    description: External workspace identifier
                required:
                  - type
                  - external_workspace_id
              - properties:
                  type:
                    type: string
                    enum:
                      - workspace
                  id:
                    type: string
                    format: uuid
                    description: >-
                      UUID of an existing workspace or temp-id that references
                      an workspace defined in the included array
                required:
                  - type
                  - id
    PersonRelationshipItem:
      type: object
      properties:
        type:
          type: string
          enum:
            - people
        id:
          type: string
          description: Person ID
        attributes:
          $ref: '#/components/schemas/PersonAttributes'
    CompanyRelationshipItem:
      type: object
      properties:
        type:
          type: string
          enum:
            - company
        id:
          type: string
          description: Company ID
        attributes:
          $ref: '#/components/schemas/CompanyAttributes'
    WorkspaceRelationshipItem:
      type: object
      properties:
        type:
          type: string
          enum:
            - workspace
        id:
          type: string
          description: Workspace ID
        attributes:
          $ref: '#/components/schemas/WorkspaceAttributes'
    PersonAttributes:
      type: object
      description: Person attribute data
      properties:
        first_name:
          type: string
          description: Person's first name
          example: Marie
          minLength: 1
          maxLength: 100
        last_name:
          type: string
          description: Person's last name
          example: Dubois
          minLength: 1
          maxLength: 100
        full_name:
          type: string
          description: Auto-computed full name (first + last)
          example: Marie Dubois
          readOnly: true
        created_at:
          type: string
          format: date-time
          description: Person creation timestamp (UTC)
          example: '2024-01-15T10:30:00Z'
          readOnly: true
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Last modification timestamp (UTC)
          example: '2024-01-16T14:20:00Z'
          readOnly: true
      required:
        - first_name
        - last_name
        - created_at
    CompanyAttributes:
      type: object
      properties:
        description:
          type: string
        domain_name_primary_link_url:
          type: string
          format: url
          maxLength: 500
          description: >-
            The domain url from the website or email address of the company.
            Used as unique identifier in some cases.
          examples:
            - acme.com
        tax_id:
          type: object
          properties:
            value:
              description: Tax ID issued by local or national tax authority.
              type: string
              examples:
                - DE123456789
            type:
              description: >-
                Type of tax ID, useful for applying formatting and validation
                rules.
              type: string
              examples:
                - VAT
        registration:
          type: object
          properties:
            trade_name:
              description: Commercial or branding name (if different from registered name).
              type: string
              examples:
                - TechSol
            registered_name:
              description: Legal company name.
              type: string
              minLength: 1
              maxLength: 100
              examples:
                - Red Hat Inc.
        registration_number:
          type: object
          properties:
            business_type:
              description: Legal entity structure type.
              type: string
              examples:
                - GmbH
            value:
              description: Official company registration number.
              type: string
              examples:
                - HRB 123456
            registry_name:
              description: Name of the official registration body.
              type: string
              examples:
                - Handelsregister Berlin
            registry_country:
              description: Country of the registry authority. (string (ISO 3166-1 alpha-2))
              type: string
              examples:
                - DE
        workspace_id:
          type: string
          format: uuid
          description: UUID of the workspace associated with this company
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    WorkspaceAttributes:
      type: object
      properties:
        name:
          type: string
          description: Workspace name
        desription:
          type: string
          description: Workspace description
        external_workspace_id:
          type: string
          format: uuid
          description: external workspace id
        avatar_color:
          type: string
          format: colors
          description: Color of the avatar
        created_at:
          type: string
          format: date-time
          description: Timestamp when the workspace was created
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the workspace was last updated

````