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

# List relationship definitions

> Retrieves all relationship definitions in the workspace



## OpenAPI

````yaml /api-reference/openapi.json get /v1/relationships
openapi: 3.0.0
info:
  description: >-
    REST API for accessing and managing your Nex data. Generate API keys from
    the Nex web UI and use them to authenticate requests.
  title: Nex Developer API
  contact: {}
  version: '1.0'
servers:
  - url: https://app.nex.ai/api/developers
security: []
paths:
  /v1/relationships:
    get:
      tags:
        - Relationships
      summary: List relationship definitions
      description: Retrieves all relationship definitions in the workspace
      operationId: listRelationshipDefinitions
      responses:
        '200':
          description: List of relationship definitions
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/developer.ListRelationshipDefinitionsResponse
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    developer.ListRelationshipDefinitionsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/developer.RelationshipDefinitionResponse'
    httpx.APIError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    developer.RelationshipDefinitionResponse:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - one_to_one
            - one_to_many
            - many_to_many
        entity_definition_1_id:
          type: string
        entity_definition_2_id:
          type: string
        entity_1_to_2_predicate:
          type: string
        entity_2_to_1_predicate:
          type: string
        created_at:
          type: string
          format: date-time
      example:
        id: '789'
        type: one_to_many
        entity_definition_1_id: '123'
        entity_definition_2_id: '456'
        entity_1_to_2_predicate: has
        entity_2_to_1_predicate: belongs to
        created_at: '2024-01-15T10:00:00Z'
  securitySchemes:
    ApiKeyAuth:
      description: 'API key for authentication (format: "Bearer YOUR_API_KEY")'
      type: apiKey
      name: Authorization
      in: header

````