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

# Consultar agendamentos

> Consulta os agendamentos vinculados a um contato informado pelo identificador único.

**URL completa:** `https://services.leadconnectorhq.com/contacts/{contactId}/appointments`

> [!NOTE]
>
> **Token e permissões:** na Salez, acesse **Configurações > Integrações Privadas** para gerar ou gerenciar o token, conforme seu nível de acesso. Esta operação exige o escopo `contacts.readonly`. Envie `Authorization: Bearer <token>` e `Version: v3`.  Veja a [visão geral de Contatos](https://docs.salez.com.br/contatos/visao-geral.md).


## OpenAPI

````yaml openapi.json GET /contacts/{contactId}/appointments
openapi: 3.0.0
info:
  title: Salez API
  version: v3
  description: >-
    Documentação da API da Salez para consultar, criar e atualizar contatos e
    consultar agendamentos. Para começar, veja a visão geral do módulo Contatos,
    com orientação sobre autenticação e permissões.
servers:
  - url: https://services.leadconnectorhq.com
    description: Servidor da API Salez.
security: []
tags:
  - name: Contatos
    description: Consulta e gerenciamento de contatos da Salez.
paths:
  /contacts/{contactId}/appointments:
    get:
      tags:
        - Contatos
      summary: Consultar agendamentos
      description: >-
        Consulta os agendamentos associados ao contato identificado por
        `contactId`.


        **Escopo necessário:** `contacts.readonly`. Consulte a [visão geral do
        módulo Contatos](/contatos/visao-geral) para gerar o token e configurar
        a autenticação.
      operationId: get-appointments-for-contact
      parameters:
        - name: Version
          in: header
          description: 'Versão obrigatória da API: `v3`.'
          required: true
          schema:
            type: string
        - name: contactId
          required: true
          in: path
          description: Identificador único do contato.
          schema:
            example: ve9EPM428h8vShlRW1KT
            type: string
      responses:
        '200':
          description: Resposta de sucesso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEventsSuccessfulResponseDto'
        '400':
          description: Requisição inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Não autorizado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Não foi possível processar os dados enviados.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - bearer: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://services.leadconnectorhq.com/contacts/{contactId}/appointments' \
              --header 'Authorization: Bearer <token>' \
              --header 'Version: v3'
components:
  schemas:
    GetEventsSuccessfulResponseDto:
      type: object
      properties:
        events:
          description: Lista de agendamentos.
          example:
            - id: YS3jaqqeehkR2Is80miy
              calendarId: YlWd2wuCAZQzh2cH1fVZ
              status: booked
              title: Test
              assignedUserId: YlWd2wuCAZQzh2cH1fVZ
              notes: test
              startTime: '2021-07-16 11:00:00'
              endTime: '2021-07-16 11:30:00'
          type: array
          items:
            $ref: '#/components/schemas/GetEventSchema'
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          example:
            - Unprocessable Entity
          type: array
          items:
            type: string
        error:
          type: string
          example: Unprocessable Entity
    GetEventSchema:
      type: object
      properties:
        id:
          type: string
          description: Identificador único do agendamento.
          example: YS3jaqqeehkR2Is80miy
        calendarId:
          type: string
          description: ID do calendário associado ao agendamento.
          example: YlWd2wuCAZQzh2cH1fVZ
        status:
          type: string
          description: Status do agendamento.
          example: booked
        title:
          type: string
          description: Título do agendamento.
          example: Test
        assignedUserId:
          type: string
          description: ID do usuário responsável pelo agendamento.
          example: YlWd2wuCAZQzh2cH1fVZ
        notes:
          type: string
          description: Anotações do agendamento.
          example: test
        startTime:
          type: string
          description: Data e hora de início do agendamento.
          example: '2021-07-16 11:00:00'
        endTime:
          type: string
          description: Data e hora de término do agendamento.
          example: '2021-07-16 11:30:00'
        address:
          type: string
          description: Endereço do agendamento.
          example: Address
        locationId:
          type: string
          description: ID da subconta do agendamento.
          example: YlWd2wuCAZQzh2cH1fVZ
        contactId:
          type: string
          description: ID do contato associado ao agendamento.
          example: YlWd2wuCAZQzh2cH1fVZ
        groupId:
          type: string
          description: ID do grupo do agendamento.
          example: YlWd2wuCAZQzh2cH1fVZ
        appointmentStatus:
          type: string
          description: Status do agendamento.
          example: booked
        users:
          description: Lista de IDs dos usuários responsáveis pelo agendamento.
          example:
            - YlWd2wuCAZQzh2cH1fVZ
            - YlWd2wuCAZQzh2cH1fVZ
          type: array
          items:
            type: string
        dateAdded:
          type: string
          description: Data de criação do agendamento.
          example: '2021-07-16 11:00:00'
        dateUpdated:
          type: string
          description: Data da última atualização do agendamento.
          example: '2021-07-16 11:30:00'
        assignedResources:
          description: Lista de IDs dos recursos atribuídos ao agendamento.
          example:
            - YlWd2wuCAZQzh2cH1fVZ
            - YlWd2wuCAZQzh2cH1fVZ
          type: array
          items:
            type: string
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use um token autorizado da subconta. Gere ou gerencie a integração em
        Configurações > Integrações Privadas na Salez, conforme as permissões do
        usuário. Informe o token no formato Bearer.
      type: http

````

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