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

> Check the current tail of an S2 stream.

# Check the tail.

<CardGroup cols={3}>
  <Card title="Read interfaces" icon="list-timeline" href="/concepts/reads#interfaces">
    See when to use reads, read sessions, or check-tail calls.
  </Card>

  <Card title="Stream positions" icon="water" href="/concepts/streams#positions">
    Head, tail, sequence numbers, and timestamps.
  </Card>

  <Card title="Reading SDK" icon="code" href="/sdk/reading#check-tail">
    Check the tail from SDK clients.
  </Card>
</CardGroup>


## OpenAPI

````yaml get /streams/{stream}/records/tail
openapi: 3.1.0
info:
  title: S2, the durable streams API
  description: Streams as a cloud storage primitive.
  termsOfService: https://s2.dev/terms
  contact:
    email: support@s2.dev
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://aws.s2.dev/v1
security:
  - access_token: []
tags:
  - name: metrics
    description: Usage metrics and data.
  - name: basins
    description: Manage basins
  - name: access-tokens
    description: Manage access tokens
  - name: locations
    description: Manage locations
  - name: streams
    description: Manage streams
  - name: records
    description: Manage records
paths:
  /streams/{stream}/records/tail:
    servers:
      - url: https://{basin}.b.s2.dev/v1
        description: Endpoint for the basin
        variables:
          basin:
            default: ''
            description: Basin name
    get:
      tags:
        - records
      summary: Check the tail.
      operationId: check_tail
      parameters:
        - name: stream
          in: path
          description: Stream name.
          required: true
          schema:
            $ref: '#/components/schemas/StreamNameStr'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TailResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '408':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
components:
  schemas:
    StreamNameStr:
      type: string
      maxLength: 512
      minLength: 1
    TailResponse:
      type: object
      required:
        - tail
      properties:
        tail:
          $ref: '#/components/schemas/StreamPosition'
          description: >-
            Sequence number that will be assigned to the next record on the
            stream, and timestamp of the last record.
    ErrorInfo:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    StreamPosition:
      type: object
      description: Position of a record in a stream.
      required:
        - seq_num
        - timestamp
      properties:
        seq_num:
          $ref: '#/components/schemas/u64'
          description: Sequence number assigned by the service.
        timestamp:
          $ref: '#/components/schemas/u64'
          description: >-
            Timestamp, which may be client-specified or assigned by the service.

            If it is assigned by the service, it will represent milliseconds
            since Unix epoch.
    u64:
      type: integer
      format: int64
      minimum: 0
  securitySchemes:
    access_token:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your access token.

````