> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create span annotations



## OpenAPI

````yaml post /v1/span_annotations
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/span_annotations:
    post:
      tags:
        - spans
      summary: Create span annotations
      operationId: annotateSpans
      parameters:
        - name: sync
          in: query
          required: false
          schema:
            type: boolean
            description: If true, fulfill request synchronously.
            default: false
            title: Sync
          description: If true, fulfill request synchronously.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnnotateSpansRequestBody'
      responses:
        '200':
          description: Span annotations inserted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnnotateSpansResponseBody'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                type: string
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Span not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AnnotateSpansRequestBody:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SpanAnnotationData'
          type: array
          title: Data
      type: object
      required:
        - data
      title: AnnotateSpansRequestBody
    AnnotateSpansResponseBody:
      properties:
        data:
          items:
            $ref: '#/components/schemas/InsertedSpanAnnotation'
          type: array
          title: Data
      type: object
      required:
        - data
      title: AnnotateSpansResponseBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpanAnnotationData:
      properties:
        name:
          type: string
          title: Name
          description: The name of the annotation
        annotator_kind:
          type: string
          enum:
            - LLM
            - CODE
            - HUMAN
          title: Annotator Kind
          description: The kind of annotator used for the annotation
        result:
          anyOf:
            - $ref: '#/components/schemas/AnnotationResult'
            - type: 'null'
          description: The result of the annotation
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Metadata for the annotation
        identifier:
          type: string
          title: Identifier
          description: >-
            The identifier of the annotation. If provided, the annotation will
            be updated if it already exists.
          default: ''
        span_id:
          type: string
          title: Span Id
          description: OpenTelemetry Span ID (hex format w/o 0x prefix)
      type: object
      required:
        - name
        - annotator_kind
        - span_id
      title: SpanAnnotationData
    InsertedSpanAnnotation:
      properties:
        id:
          type: string
          title: Id
          description: The ID of the inserted span annotation
      type: object
      required:
        - id
      title: InsertedSpanAnnotation
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnnotationResult:
      properties:
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
          description: The label assigned by the annotation
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
          description: The score assigned by the annotation
        explanation:
          anyOf:
            - type: string
            - type: 'null'
          title: Explanation
          description: Explanation of the annotation result
      type: object
      title: AnnotationResult

````