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

# Pin a subscriber's location

> Pins an explicit location to a subscriber, overriding any location Kit has inferred from open events. Provide `city`, `state_province`, `country_code` (ISO 3166-1 alpha-2, required), `latitude`, `longitude`, and `timezone` (IANA timezone name, e.g. `America/Denver`). Returns the subscriber's `id` and the pinned `location` on success.

If the subscriber already has a pinned location this replaces it. To replace the values on an existing pin, use [Update a subscriber's pinned location](/api-reference/subscribers/update-a-subscribers-pinned-location) (PATCH); to remove the pin, use [Delete a subscriber's location](/api-reference/subscribers/delete-a-subscribers-location). The pinned location is returned on [Get a subscriber](/api-reference/subscribers/get-a-subscriber). Returns `404` when the subscriber is not found, `422` when a required field is missing or invalid.



## OpenAPI

````yaml /api-reference/v4.json post /v4/subscribers/{subscriber_id}/location
openapi: 3.0.3
info:
  title: Kit API
  version: '4.0'
servers:
  - url: https://api.kit.com
security: []
paths:
  /v4/subscribers/{subscriber_id}/location:
    post:
      tags:
        - Subscribers
      summary: Pin a subscriber's location
      description: >-
        Pins an explicit location to a subscriber, overriding any location Kit
        has inferred from open events. Provide `city`, `state_province`,
        `country_code` (ISO 3166-1 alpha-2, required), `latitude`, `longitude`,
        and `timezone` (IANA timezone name, e.g. `America/Denver`). Returns the
        subscriber's `id` and the pinned `location` on success.


        If the subscriber already has a pinned location this replaces it. To
        replace the values on an existing pin, use [Update a subscriber's pinned
        location](/api-reference/subscribers/update-a-subscribers-pinned-location)
        (PATCH); to remove the pin, use [Delete a subscriber's
        location](/api-reference/subscribers/delete-a-subscribers-location). The
        pinned location is returned on [Get a
        subscriber](/api-reference/subscribers/get-a-subscriber). Returns `404`
        when the subscriber is not found, `422` when a required field is missing
        or invalid.
      parameters:
        - name: subscriber_id
          in: path
          required: true
          schema:
            type: integer
          example: 1105
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                location:
                  type: object
                  properties:
                    city:
                      type: string
                    state_province:
                      type: string
                    country_code:
                      type: string
                    latitude:
                      type: number
                      format: float
                    longitude:
                      type: number
                      format: float
                    timezone:
                      type: string
                  required:
                    - city
                    - state_province
                    - country_code
                    - latitude
                    - longitude
                    - timezone
              required:
                - location
            example:
              location:
                city: Boise
                state_province: Idaho
                country_code: US
                latitude: 43.62
                longitude: -116.2
                timezone: America/Denver
      responses:
        '200':
          description: Pins the location and returns it
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscriber:
                    type: object
                    properties:
                      id:
                        type: integer
                      location:
                        type: object
                        properties:
                          city:
                            type: string
                          state_province:
                            type: string
                          country_code:
                            type: string
                          latitude:
                            type: number
                            format: float
                          longitude:
                            type: number
                            format: float
                          timezone:
                            type: string
                        required:
                          - city
                          - state_province
                          - country_code
                          - latitude
                          - longitude
                          - timezone
                    required:
                      - id
                      - location
                required:
                  - subscriber
              example:
                subscriber:
                  id: 1100
                  location:
                    city: Boise
                    state_province: Idaho
                    country_code: US
                    latitude: 43.62
                    longitude: -116.2
                    timezone: America/Denver
        '401':
          description: Returns a 401 if the token and/or account cannot be authenticated
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - errors
              example:
                errors:
                  - The access token is invalid
        '404':
          description: Returns 404 for an unknown subscriber
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - errors
              example:
                errors:
                  - Not Found
        '422':
          description: Returns 422 and does not persist when country_code is missing
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                required:
                  - errors
              example:
                errors:
                  - Country code can't be blank
      security:
        - API Key: []
        - OAuth2: []
components:
  securitySchemes:
    API Key:
      description: Authenticate API requests via an API Key
      type: apiKey
      in: header
      name: X-Kit-Api-Key
    OAuth2:
      description: Authenticate API requests via an OAuth token
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.kit.com/v4/oauth/authorize
          tokenUrl: https://api.kit.com/v4/oauth/token
          refreshUrl: https://api.kit.com/v4/oauth/token
          scopes:
            read: Read access to Kit API v4
            write: Write access to Kit API v4

````