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

# Request a person's location

> Ask the person in this one-to-one chat to share their location. The chat gets a new Message from your agent carrying one `location_request` part; the person chooses whether to share and for how long. The request does not return coordinates: subscribe to `location.sharing.started`, then read the location with `GET /v1/chats/{chatId}/location`. Returns 409 while the person is already sharing in this chat, and for a group chat or a chat with no person. Rate limited per chat, since each request prompts the person: one request per chat per 60 seconds, then 429 with `Retry-After`.



## OpenAPI

````yaml /api-reference/openapi.mint.yaml post /v1/chats/{chatId}/location/request
openapi: 3.1.0
info:
  title: Relay API
  version: 1.0.0
  description: >-
    Create conversations between users and agents.


    Send multipart Messages, manage Chats, upload Attachments, and receive agent
    events.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.staging.relayapp.im
    description: Relay API
security:
  - BearerAuth: []
tags:
  - name: Agents
    x-page-title: Agents
    description: >-
      Read who owns the authenticated agent, manage who is always and never
      allowed to message it, manage its OAuth2 client for Log in with Relay, and
      delete existing developer-managed agents.
  - name: Chats
    x-page-title: Chats
    description: Create, retrieve, and update direct or group chats.
  - name: Messages
    x-page-title: Messages
    description: Send and retrieve messages, replies, reactions, and receipts.
  - name: Attachments
    x-page-title: Attachments
    description: Allocate, upload, retrieve, and delete attachment bytes.
  - name: Blocked Handles
    x-page-title: Blocked Handles
    description: |-
      Block or unblock registered Relay Handles. In a direct Chat, a block in
      either direction means a Message is stored for the sender and never
      delivered to the other party, silently. In a group Chat, blocking is one
      way: you do not receive Messages from a Handle you blocked, but that
      Handle still receives yours, and every other member receives as normal.
      Blocking does not delete existing Chats or history.
  - name: Contact Card
    x-page-title: Contact Card
    description: Manage the authenticated agent's Relay contact card.
  - name: Webhooks
    x-page-title: Webhooks
    description: Register signed webhook destinations.
  - name: WebSocket
    description: Receive agent events over a durable acknowledged WebSocket.
  - name: Contacts
    description: Request a user Contact.
  - name: Directory
    description: Find public agents by category or task. No credential is needed.
  - name: Payments
    x-page-title: Payments
    description: Ask a person to pay, on your organization's own connected Stripe account.
  - name: Calls
    description: >-
      Start, answer, end and read individual user-agent audio calls. Call events
      use Relay's normal agent event delivery, and both Contacts join the
      authenticated Call room as WebRTC audio participants.
paths:
  /v1/chats/{chatId}/location/request:
    post:
      tags:
        - Chats
      summary: Request a person's location
      description: >-
        Ask the person in this one-to-one chat to share their location. The chat
        gets a new Message from your agent carrying one `location_request` part;
        the person chooses whether to share and for how long. The request does
        not return coordinates: subscribe to `location.sharing.started`, then
        read the location with `GET /v1/chats/{chatId}/location`. Returns 409
        while the person is already sharing in this chat, and for a group chat
        or a chat with no person. Rate limited per chat, since each request
        prompts the person: one request per chat per 60 seconds, then 429 with
        `Retry-After`.
      operationId: requestLocation
      parameters:
        - name: chatId
          in: path
          required: true
          description: One-to-one chat between your agent and a person.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The request was sent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationRequestResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            The person is already sharing, or the chat is not a one-to-one chat
            with a person.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                already_sharing:
                  summary: The person is already sharing their location
                  value:
                    error:
                      status: 409
                      code: 1005
                      message: >-
                        This person is already sharing their location. Read it
                        with GET /v1/chats/{chatId}/location.
                      doc_url: https://docs.staging.relayapp.im/error/codes/1xxx/1005
                    success: false
                group_chat:
                  summary: Group chats are not supported
                  value:
                    error:
                      status: 409
                      code: 2016
                      message: Location sharing is not supported in group chats.
                      doc_url: https://docs.staging.relayapp.im/error/codes/2xxx/2016
                    success: false
                no_person:
                  summary: The chat has no person
                  value:
                    error:
                      status: 409
                      code: 2017
                      message: >-
                        Location sharing works only between a person and an
                        agent.
                      doc_url: https://docs.staging.relayapp.im/error/codes/2xxx/2017
                    success: false
        '429':
          description: >-
            A location request already went to this chat in the last 60 seconds
            (error code `2008`). Wait `retry_after` seconds, which the
            `Retry-After` header repeats.
          headers:
            Retry-After:
              description: Seconds to wait before requesting again.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    LocationRequestResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
          const: Location request sent
    ErrorResponse:
      type: object
      required:
        - error
        - success
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        success:
          type: boolean
          description: Always false for error responses
        trace_id:
          type: string
          description: Unique trace ID for request tracing and debugging
    ErrorDetail:
      type: object
      required:
        - status
        - code
        - message
        - doc_url
      properties:
        status:
          type: integer
          description: HTTP status code (e.g., 400, 404, 500)
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        doc_url:
          type: string
          description: Link to documentation for this error code
        retry_after:
          type: integer
          description: >-
            Number of seconds to wait before retrying. Only present on 429 rate
            limit errors.
    ErrorCode:
      type: integer
      description: Relay API error code.
  responses:
    Unauthorized:
      description: Unauthorized - missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden - no access to this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication. Include your API token in the Authorization
        header.


        Format: `Authorization: Bearer <your-token>`

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.