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

# Retrieve visits

> Retrieve visits. <h3>OAuth</h3>Required scopes: <code>visitors.readonly</code> or <code>visitors</code>



## OpenAPI

````yaml /assets/openapi.json get /visitors/visits/v1
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /visitors/visits/v1:
    get:
      tags:
        - Visitors
      summary: Retrieve visits
      description: >-
        Retrieve visits. <h3>OAuth</h3>Required scopes:
        <code>visitors.readonly</code> or <code>visitors</code>
      operationId: getVisits
      parameters:
        - name: locationRef
          in: query
          description: The id of the location.
          schema:
            type: string
            format: uuid
          required: true
        - in: query
          name: userRefHost
          description: The id of the user, host of the visit.
          schema:
            type: string
            format: uuid
          required: false
        - in: query
          name: createDate
          description: The date filter of items.
          schema:
            type: object
            properties:
              lte:
                format: date-time
                type: string
                description: >-
                  Get visits with less or equal create date. Example:
                  createDate[lte]=2021-05-21T10:00:00Z
              gte:
                format: date-time
                type: string
                description: >-
                  Get visits with greater or equal create date. Example:
                  createDate[gte]=2021-05-21T10:00:00Z
        - in: query
          name: limit
          schema:
            type: integer
            format: int64
            minimum: 1
            maximum: 100
            default: 25
          description: The number of items to return
        - in: query
          name: nextPageToken
          schema:
            $ref: '#/components/schemas/nextPageToken'
          description: Token to retrieve the next page of results.
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  nextPageToken:
                    $ref: '#/components/schemas/nextPageToken'
                  searchQueryNext:
                    $ref: '#/components/schemas/searchQueryNext'
                  visits:
                    type: array
                    items:
                      $ref: '#/components/schemas/visit'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - visitors.readonly
            - visitors
components:
  schemas:
    nextPageToken:
      type: string
      description: >-
        Opaque cursor token for retrieving the next page of results. Pass this
        value as the `nextPageToken` query parameter in your next request.
    searchQueryNext:
      type: string
      description: >-
        Pre-built query string for the next page of results. Contains all active
        filter parameters combined with the next page token, ready to append to
        the endpoint URL.
    visit:
      type: object
      properties:
        checkInDate:
          description: ISO timestamp when the visitor checked in.
          type: string
          format: date-time
        checkOutDate:
          description: ISO timestamp when the visitor checked out.
          type: string
          format: date-time
        code:
          description: Visit access code.
          type: string
        comment:
          description: Optional comment on the visit.
          type: string
        createDate:
          description: ISO timestamp of when the visit was created.
          type: string
          format: date-time
        date:
          description: ISO timestamp of the scheduled visit date.
          type: string
          format: date-time
        id:
          description: Unique identifier of the visit.
          type: string
          format: uuid
        location:
          description: Location where the visit takes place.
          type: object
          properties:
            address:
              description: Street address of the location.
              type: string
            id:
              description: Unique identifier of the location.
              type: string
              format: uuid
            timezoneId:
              description: IANA timezone identifier of the location.
              type: string
            title:
              description: Display name of the location.
              type: string
          required:
            - id
            - timezoneId
            - title
          additionalProperties: false
        locationRef:
          description: ID of the location where the visit takes place.
          type: string
          format: uuid
        membershipRefHost:
          description: ID of the host membership.
          type: string
          format: uuid
        userHost:
          description: Host user details.
          type: object
          properties:
            about:
              description: About text of the host user.
              nullable: true
              type: string
            email:
              description: Email of the host user.
              nullable: true
              type: string
            id:
              description: Unique identifier of the host user.
              type: string
              format: uuid
            name:
              description: First name of the host user.
              nullable: true
              type: string
            phoneNumber:
              description: Phone number of the host user.
              nullable: true
              type: string
            photoUrl:
              description: Profile photo URL of the host user.
              nullable: true
              type: string
            surname:
              description: Surname of the host user.
              nullable: true
              type: string
          required:
            - id
          additionalProperties: false
        userRefHost:
          description: ID of the host user.
          type: string
          format: uuid
        userRefVisitor:
          description: ID of the visitor user.
          type: string
          format: uuid
        visitor:
          description: Visitor details.
          type: object
          properties:
            email:
              description: Visitor email address.
              type: string
            name:
              description: Visitor first name.
              type: string
            phoneNumber:
              description: Visitor phone number.
              type: string
            surname:
              description: Visitor surname.
              type: string
          required:
            - email
            - name
          additionalProperties: false
      required:
        - code
        - createDate
        - date
        - id
        - location
        - locationRef
        - membershipRefHost
        - userHost
        - userRefHost
        - userRefVisitor
        - visitor
      additionalProperties: false
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````