components:
  headers:
    API-Version:
      description: De API-versie van de response
      example: 1.0.0
      schema:
        example: 1.0.0
        type: string
  responses:
    "404":
      $ref: https://static.developer.overheid.nl/adr/components.yaml#/responses/404
  schemas:
    CreateApiInput:
      properties:
        contact:
          $ref: '#/components/schemas/ModelsContact'
        id:
          type: string
        oasUrl:
          type: string
        organisationUri:
          type: string
      type: object
    CreateOrganisationInput:
      properties:
        label:
          type: string
        uri:
          type: string
      type: object
    ModelsApiDetail:
      properties:
        _links:
          $ref: '#/components/schemas/ModelsLinks'
        adrScore:
          format: int32
          nullable: true
          type: integer
        auth:
          items:
            type: string
          type: array
        contact:
          $ref: '#/components/schemas/ModelsContact'
        description:
          type: string
        docsUrl:
          type: string
        id:
          type: string
        lifecycle:
          $ref: '#/components/schemas/ModelsLifecycle'
        lintResults:
          items:
            $ref: '#/components/schemas/ModelsLintResult'
          type: array
        oasUrl:
          type: string
        organisation:
          $ref: '#/components/schemas/ModelsOrganisationSummary'
        servers:
          items:
            $ref: '#/components/schemas/ModelsServerInfo'
          type: array
        title:
          type: string
      type: object
    ModelsApiSummary:
      properties:
        _links:
          $ref: '#/components/schemas/ModelsLinks'
        adrScore:
          format: int32
          nullable: true
          type: integer
        contact:
          $ref: '#/components/schemas/ModelsContact'
        description:
          type: string
        id:
          type: string
        lifecycle:
          $ref: '#/components/schemas/ModelsLifecycle'
        oasUrl:
          type: string
        organisation:
          $ref: '#/components/schemas/ModelsOrganisationSummary'
        title:
          type: string
      type: object
    ModelsContact:
      properties:
        email:
          type: string
        name:
          type: string
        url:
          type: string
      type: object
    ModelsLifecycle:
      properties:
        deprecated:
          type: string
        status:
          type: string
        sunset:
          type: string
        version:
          type: string
      type: object
    ModelsLink:
      properties:
        href:
          type: string
      type: object
    ModelsLinks:
      properties:
        apis:
          $ref: '#/components/schemas/ModelsLink'
        first:
          $ref: '#/components/schemas/ModelsLink'
        last:
          $ref: '#/components/schemas/ModelsLink'
        next:
          $ref: '#/components/schemas/ModelsLink'
        prev:
          $ref: '#/components/schemas/ModelsLink'
        self:
          $ref: '#/components/schemas/ModelsLink'
      type: object
    ModelsLintMessage:
      properties:
        CreatedAt:
          format: date-time
          type: string
        code:
          type: string
        column:
          format: int32
          type: integer
        id:
          type: string
        infos:
          items:
            $ref: '#/components/schemas/ModelsLintMessageInfo'
          type: array
        line:
          format: int32
          type: integer
        lintResultId:
          type: string
        severity:
          type: string
      type: object
    ModelsLintMessageInfo:
      properties:
        id:
          type: string
        lintMessageId:
          type: string
        message:
          type: string
        path:
          type: string
      type: object
    ModelsLintResult:
      properties:
        ApiID:
          type: string
        CreatedAt:
          format: date-time
          type: string
        ID:
          type: string
        failures:
          format: int32
          type: integer
        messages:
          items:
            $ref: '#/components/schemas/ModelsLintMessage'
          type: array
        successes:
          type: boolean
        warnings:
          format: int32
          type: integer
      type: object
    ModelsOrganisation:
      properties:
        label:
          type: string
        uri:
          type: string
      type: object
    ModelsOrganisationSummary:
      properties:
        _links:
          $ref: '#/components/schemas/ModelsLinks'
        label:
          type: string
        uri:
          type: string
      type: object
    ModelsServerInfo:
      properties:
        description:
          type: string
        url:
          type: string
      type: object
    UpdateApiInput:
      properties:
        contact:
          $ref: '#/components/schemas/ModelsContact'
        oasUrl:
          type: string
        organisationUri:
          type: string
      type: object
info:
  contact:
    email: developer.overheid@geonovum.nl
    name: Team developer.overheid.nl
    url: https://github.com/developer-overheid-nl/don-api-register/issues
  description: API van het API register (apis.developer.overheid.nl)
  title: API register API v1
  version: 1.0.0
openapi: 3.0.1
paths:
  /v1/apis:
    get:
      description: Geeft een lijst met alle geregistreerde API's terug.
      operationId: listApis
      parameters:
      - in: query
        name: ids
        schema:
          nullable: true
          type: string
      - in: query
        name: organisation
        schema:
          nullable: true
          type: string
      - in: query
        name: page
        schema:
          format: int32
          type: integer
      - in: query
        name: perPage
        schema:
          format: int32
          type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ModelsApiSummary'
                type: array
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Alle API's ophalen
      tags:
      - Publieke endpoints
    post:
      description: Registreer een nieuwe API met een OpenAPI URL.
      operationId: createApi
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiInput'
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsApiSummary'
          description: Created
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:write
      summary: Registreer een nieuwe API
      tags:
      - Private endpoints
  /v1/apis/_search:
    get:
      description: Zoekt geregistreerde API's op basis van titel.
      operationId: searchApis
      parameters:
      - in: query
        name: organisation
        schema:
          nullable: true
          type: string
      - in: query
        name: page
        schema:
          format: int32
          type: integer
      - in: query
        name: perPage
        schema:
          format: int32
          type: integer
      - in: query
        name: q
        schema:
          type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ModelsApiSummary'
                type: array
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Zoek API's
      tags:
      - Publieke endpoints
  /v1/apis/{id}:
    get:
      description: Geeft de details van een specifieke API terug.
      operationId: retrieveApi
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsApiDetail'
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Specifieke API ophalen
      tags:
      - Publieke endpoints
    put:
      description: Update een bestaande API.
      operationId: updateApi
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApiInput'
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsApiSummary'
          description: Created
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:write
      summary: Specifieke API updaten
      tags:
      - Private endpoints
  /v1/apis/{id}/bruno:
    get:
      description: Geeft de gegenereerde Bruno ZIP terug.
      operationId: getBruno
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Download Bruno project
      tags:
      - Publieke endpoints
  /v1/apis/{id}/oas/{version}:
    get:
      description: Geeft de OAS 3.0 of 3.1 specificatie in JSON of YAML terug.
      operationId: getOasVersion
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: version
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Download OAS document
      tags:
      - Publieke endpoints
  /v1/apis/{id}/postman:
    get:
      description: Geeft de gegenereerde Postman JSON terug.
      operationId: getPostman
      parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - apis:read
      summary: Download Postman collectie
      tags:
      - Publieke endpoints
  /v1/organisations:
    get:
      description: Geeft een lijst van alle organisaties terug.
      operationId: listOrganisations
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ModelsOrganisationSummary'
                type: array
          description: OK
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - organisations:read
      summary: Alle organisaties ophalen
      tags:
      - Private endpoints
    post:
      description: Voeg een organisatie toe op basis van URI en label.
      operationId: createOrganisation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrganisationInput'
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelsOrganisation'
          description: Created
          headers:
            API-Version:
              description: De API-versie van de response
              schema:
                type: string
        "404":
          description: Not Found
      security:
      - apiKey: []
        clientCredentials:
        - organisations:write
      summary: Voeg een nieuwe organisatie toe
      tags:
      - Private endpoints
servers:
- description: Production
  url: https://api.developer.overheid.nl/api-register
- description: Test
  url: https://api.don.apps.digilab.network/api-register
tags:
- description: API Register V1 routes
  name: API v1
- description: Bewerken van API's
  name: Private endpoints
- description: Alleen lezen endpoints
  name: Publieke endpoints
