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

# Curate ontology links

> Run the OntologyCurator agent to analyze computed links for a dataset or all datasets in a namespace. When activate is true, the curated links are added to the ontology. When activate is false (default), only returns the curated links without activating them.



## OpenAPI

````yaml /api-reference/openapi.yml post /ontology/curate-links
openapi: 3.0.3
info:
  title: DataLinks
  version: 2.2.3
servers:
  - url: https://api.datalinks.com/api/v1
    description: production server
security:
  - bearerAuth: []
  - openId:
      - implicit
paths:
  /ontology/curate-links:
    post:
      tags:
        - ontology
      summary: Curate ontology links
      description: >-
        Run the OntologyCurator agent to analyze computed links for a dataset or
        all datasets in a namespace. When activate is true, the curated links
        are added to the ontology. When activate is false (default), only
        returns the curated links without activating them.
      operationId: curateLinks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CurateLinkRequest'
            examples:
              curateDataset:
                summary: Curate links for a specific dataset (without activating)
                value:
                  namespace: my_namespace
                  dataset: my_dataset
              curateAndActivate:
                summary: Curate and activate links
                value:
                  namespace: my_namespace
                  dataset: my_dataset
                  activate: true
              curateNamespace:
                summary: Curate links for all datasets in a namespace
                value:
                  namespace: my_namespace
              curateWithModel:
                summary: Curate using a specific LLM model
                value:
                  namespace: my_namespace
                  dataset: my_dataset
                  model: gpt-4
                  provider: openai
        required: true
      responses:
        '200':
          description: Links curated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurateLinkResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CurateLinkRequest:
      required:
        - namespace
      type: object
      properties:
        namespace:
          type: string
          description: The namespace containing the dataset(s) to curate.
          example: my_namespace
        dataset:
          type: string
          description: >-
            Optional. If specified, curates links only for this dataset. If
            omitted, curates all datasets in the namespace.
          example: my_dataset
        model:
          type: string
          description: >-
            Optional. The LLM model to use for curation (e.g., "gpt-4",
            "claude-3-5-sonnet-20241022").
          example: gpt-4
        provider:
          type: string
          description: Optional. The LLM provider to use (e.g., "openai", "anthropic").
          example: openai
        activate:
          type: boolean
          description: >-
            Optional. If true, the curated links will be activated (added to the
            ontology). If false, only returns the curated links without
            activating them.
          default: false
      description: >-
        Request to curate ontology links for a dataset or namespace using the
        OntologyCurator agent.
    CurateLinkResponse:
      required:
        - datasetsProcessed
        - totalSelected
      type: object
      properties:
        datasetsProcessed:
          type: integer
          description: Number of datasets that were processed.
          example: 5
        totalSelected:
          type: integer
          description: Total number of links selected by the curator agent.
          example: 45
        curatedLinks:
          type: array
          description: >-
            The curated links. Only included in the response when activate is
            false.
          items:
            $ref: '#/components/schemas/ApiLink'
      description: >-
        Response containing curation statistics and optionally the curated links
        when activate is false.
    ApiLink:
      required:
        - destination
        - hits
        - matchType
        - origin
      type: object
      properties:
        destination:
          type: string
          example: ri.user.examples.companies.other_addresses
        hits:
          type: integer
          format: int64
          example: 5
        matchType:
          type: string
          example: ExactMatch
        origin:
          type: string
          example: ri.user.examples.companies.nationalities
      example:
        destination: ri.user.examples.actor.name
        hits: 6
        matchType: ExactMatch
        origin: ri.user.examples.movies.director
    ErrorResponse:
      required:
        - error_code
        - message
      type: object
      properties:
        error_code:
          type: string
          example: UNAUTHORIZED
        error_message:
          type: string
          example: ''
        message:
          type: string
          example: Missing authentication token
        sub_errors:
          type: array
          items:
            required:
              - code
              - message
            type: object
            properties:
              code:
                type: string
              message:
                type: string
  responses:
    Unauthorized:
      description: >-
        Unauthorized. This error occurs if the authentication token is missing
        or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden. The user does not have access to this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      description: >
        Use a Bearer token for authentication. Submit the token using the
        `Authorization`

        header: `Authorization: Bearer <token>`.
      scheme: bearer
    openId:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://login.datalinks.com/realms/datalinks-realm/protocol/openid-connect/auth
          scopes:
            openid: openid

````