{
  "openapi": "3.1.1",
  "info": {
    "title": "Consents API",
    "description": "An API for handling consents within Entur's sales systems",
    "termsOfService": "https://entur.org",
    "contact": {
      "name": "Entur Team Personalisering",
      "url": "https://enturas.atlassian.net/wiki/spaces/CULP/overview",
      "email": "team.personalisering@entur.org"
    },
    "version": "2026.04.1"
  },
  "servers": [
    {
      "url": "https://api.entur.io/customers/v2/consents"
    }
  ],
  "security": [
    {
      "jwt": []
    }
  ],
  "tags": [
    {
      "name": "Consents client",
      "description": "Api for creating, fetching, modifying and deleting given consents by clients"
    },
    {
      "name": "Consents DWH",
      "description": "API for displaying all consent info (Data warehouse API)"
    },
    {
      "name": "Consents admin",
      "description": "Api for creating, fetching, modifying and deleting consents by admins"
    }
  ],
  "paths": {
    "/crm": {
      "get": {
        "tags": [
          "Consents DWH"
        ],
        "summary": "Find all given consents",
        "description": "Find all given consents. This endpoint is intended for data warehouse use and returns all consents with related contact information. \n            |The response can be filtered by consent IDs, and you can choose to include email and telephone numbers. \n            |If no filters are provided, all given consents for your organisation are returned.",
        "operationId": "findAllGivenConsents",
        "parameters": [
          {
            "name": "consentIds",
            "in": "query",
            "description": "Filter consents by its id (comma separated). Returns all consents if not provided.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              }
            },
            "examples": {
              "default": {
                "value": [
                  1,
                  2,
                  3
                ]
              }
            }
          },
          {
            "name": "includeEmail",
            "in": "query",
            "description": "Whether or not to include email in the response. Defaults to false",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "examples": {
              "default": {
                "value": true
              }
            }
          },
          {
            "name": "includeTelephoneNumber",
            "in": "query",
            "description": "Whether or not to include telephone number in the response. Defaults to false",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "examples": {
              "default": {
                "value": true
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentCrmResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": "consents-customer-data:les"
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consents": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Find consents",
        "description": "Find consents filtered by given query parameters",
        "operationId": "findConsentsAsAdmin",
        "parameters": [
          {
            "name": "organisationIds",
            "in": "query",
            "description": "Filter consents by organisation ids (comma separated).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              }
            },
            "examples": {
              "default": {
                "value": [
                  1,
                  20,
                  25
                ]
              }
            }
          },
          {
            "name": "consentCodes",
            "in": "query",
            "description": "Filter consents by consent codes (comma separated).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "examples": {
              "default": {
                "value": [
                  "ENT_INFO_SMS",
                  "ENT_INFO_EMAIL"
                ]
              }
            }
          },
          {
            "name": "versions",
            "in": "query",
            "description": "Filter consents by versions (comma separated). You can also use the keywords ALL or CURRENT. Example: versions=1,2 or versions=CURRENT",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [
                "CURRENT"
              ]
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "description": "Whether or not to include inactive consents (default: false)",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean"
            },
            "examples": {
              "default": {
                "value": false
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Add a consent",
        "description": "Add a consent to a consent base",
        "operationId": "addConsent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:opprett",
              "consents-admin-data-global:opprett"
            ]
          }
        },
        "parameters": []
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/consents": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find all consents",
        "description": "Find all consents",
        "operationId": "findAllConsents",
        "parameters": [
          {
            "name": "organisationIds",
            "in": "query",
            "description": "Filter consents by organisation ids (comma separated). If you're a partner, this will be filled out from your authentication token. Example: organisationIds=1,20",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              }
            }
          },
          {
            "name": "consentCodes",
            "in": "query",
            "description": "Filter consents by consent base codes (comma separated). Example: consentCodes=ENT_INFO_SMS,ENT_INFO_EMAIL",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "versions",
            "in": "query",
            "description": "Filter consents by consent base versions (comma separated). You can also use the keywords ALL or CURRENT.\n                |Example: versions=1,2 or versions=CURRENT\n              ",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "default": [
                "CURRENT"
              ]
            }
          },
          {
            "name": "includeInactive",
            "in": "query",
            "description": "Whether or not to include inactive consents (Default: false)",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean"
            },
            "examples": {
              "default": {
                "value": false
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consent-bases": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Find all consent bases",
        "description": "List all available consent bases",
        "operationId": "findAllConsentBases",
        "parameters": [
          {
            "name": "includeAllVersions",
            "in": "query",
            "description": "Whether or not to include all versions of all consents bases. If set to false, will only return the currently active versions. (default: false)",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean"
            },
            "examples": {
              "default": {
                "value": false
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentBaseResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Create a consent base",
        "description": "Create a consent base",
        "operationId": "addConsentBase",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentBaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:opprett",
              "consents-admin-data-global:opprett"
            ]
          }
        },
        "parameters": []
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consents/{id}": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Get a consent",
        "description": "Get a consent by its id.",
        "operationId": "getConsentAsAdmin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the consent to retrieve",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "examples": {
              "default": {
                "value": 123
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "put": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Update a draft consent",
        "description": "Update a consent by its id. Only consents in DRAFT state can be updated.",
        "operationId": "updateConsent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the consent to update",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "examples": {
              "default": {
                "value": 123
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:endre",
              "consents-admin-data-global:endre"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Delete a consent",
        "description": "Delete a consent by its id.",
        "operationId": "deleteConsent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the consent to delete",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "examples": {
              "default": {
                "value": 123
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:slett",
              "consents-admin-data-global:slett"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Update an active consent",
        "description": "Update the valid to for an active consent. This is the only thing that can be changed after a consent is active. \n        If you want to change other fields you have to create a new consent.",
        "operationId": "patchConsent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the consent to update",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "examples": {
              "default": {
                "value": 123
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:endre",
              "consents-admin-data-global:endre"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/consents/{id}": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Get a consent",
        "description": "Get a consent by its id.",
        "operationId": "getConsent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The id of the consent to retrieve",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "examples": {
              "default": {
                "value": 123
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find given consents",
        "description": "Find given consents filtered by given query parameters.",
        "operationId": "findGivenConsents",
        "parameters": [
          {
            "name": "originalDatedServiceJourneyIds",
            "in": "query",
            "description": "Search given consents by originalDatedServiceJourneyId (comma separated). Example: originalDatedServiceJourneyIds=ENT:DatedServiceJourney:XXXXX,ENT:DatedServiceJourney:YYYYY",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "lineRef",
            "in": "query",
            "description": "Search given consents by lineRef (comma separated). Example: lineRef=XXX:Line:YY,XXX:Line:ZZ",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "stopPlaces",
            "in": "query",
            "description": "Search given consents by stopPlaces (includes start and end stop) (comma separated). Example: stopPlaces=NSR:StopPlace:XXXXX,NSR:StopPlace:YYYY",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GivenConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:les",
              "consents-customer-data-global:les"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Consents client"
        ],
        "summary": "Create a given consent.",
        "description": "Create a given consent.",
        "operationId": "addGivenConsent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GivenConsentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GivenConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:opprett",
              "consents-customer-data-global:opprett"
            ]
          }
        },
        "parameters": []
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents/bulk": {
      "put": {
        "tags": [
          "Consents client"
        ],
        "summary": "Bulk update given consents.",
        "description": "Bulk update given consents for a customer. Adds new given consents or replaces existing given consents for the specified consent IDs.\n            |Consents not included in the request remain unchanged.",
        "operationId": "bulkUpdateGivenConsents",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GivenConsentBulkUpdateRequest"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GivenConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:endre",
              "consents-customer-data-global:endre"
            ]
          }
        },
        "parameters": []
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consent-bases/{consentCode}": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Find current version of consent base",
        "description": "Returns the currently active version of consent base. Returns 404 if the are no active versions.",
        "operationId": "findConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to find.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Delete a consent base",
        "description": "Delete a consent base and all it's versions",
        "operationId": "deleteConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to delete",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:slett",
              "consents-admin-data-global:slett"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents/get-by/bulk": {
      "post": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find given consents by customer references or customer numbers.",
        "description": "Find given consents by the provided customer references or customer numbers, filtered by organisation.\n            If both customer number and customer references are provided Bad Request will be returned",
        "operationId": "bulkFindGivenConsentsForCustomers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GivenConsentBulkGetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GivenConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:les",
              "consents-customer-data-global:les"
            ]
          }
        },
        "parameters": []
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents/{givenConsentId}": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find a given consent.",
        "description": "Find a given consent defined by its id.",
        "operationId": "getGivenConsent",
        "parameters": [
          {
            "name": "givenConsentId",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GivenConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:les",
              "consents-customer-data-global:les"
            ]
          }
        }
      },
      "put": {
        "tags": [
          "Consents client"
        ],
        "summary": "Update a given consent.",
        "description": "Update a given consent.",
        "operationId": "updateGivenConsent",
        "parameters": [
          {
            "name": "givenConsentId",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GivenConsentPutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GivenConsentResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:endre",
              "consents-customer-data-global:endre"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Consents client"
        ],
        "summary": "Delete given consent.",
        "description": "Delete a given consent",
        "operationId": "deleteGivenConsent",
        "parameters": [
          {
            "name": "givenConsentId",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:slett",
              "consents-customer-data-global:slett"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consent-bases/{consentCode}/versions": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Find all consent base versions",
        "description": "Returns a list of all versions for the consent base",
        "operationId": "findAllVersionsOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base for which to find versions.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentBaseResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "post": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Create a new version and update values for a consent base.",
        "description": "Create a new version and update values for a consent base.",
        "operationId": "createNewVersionOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to update.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentBaseVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:endre",
              "consents-admin-data-global:endre"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents/{customerRef}/by-customer-ref": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find all by customer reference.",
        "description": "Find all given consents associated with a customer reference.",
        "operationId": "findAllGivenConsentsByCustomerRef",
        "parameters": [
          {
            "name": "customerRef",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GivenConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:les",
              "consents-customer-data-global:les"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/admin/consent-bases/{consentCode}/versions/{version}": {
      "get": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Find version of a consent base",
        "description": "Find a specific version of a consent base",
        "operationId": "findVersionOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base for which to to find a version.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "The version to find",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "examples": {
              "default": {
                "value": 2
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:les",
              "consents-admin-data-global:les"
            ]
          }
        }
      },
      "put": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Update a consent base version.",
        "description": "Update a consent base version by its consent code. Note: you can only edit draft versions of consent bases. If you want to update an active consent base, you need to create a new version.",
        "operationId": "updateVersionOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to update.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "The version to update",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "examples": {
              "default": {
                "value": 2
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentBaseVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:endre",
              "consents-admin-data-global:endre"
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Delete a consent base version",
        "description": "Delete a consent base version",
        "operationId": "deleteVersionOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to delete version for.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "The version to delete",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "examples": {
              "default": {
                "value": 2
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:slett",
              "consents-admin-data-global:slett"
            ]
          }
        }
      },
      "patch": {
        "tags": [
          "Consents admin"
        ],
        "summary": "Patch a consent base version",
        "description": "Patch an active consent base version.",
        "operationId": "patchVersionOfConsentBase",
        "parameters": [
          {
            "name": "consentCode",
            "in": "path",
            "description": "The consent code of the consent base to patch version for.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "default": {
                "value": "ENT_INFO_SMS"
              }
            }
          },
          {
            "name": "version",
            "in": "path",
            "description": "The version to patch",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "examples": {
              "default": {
                "value": 2
              }
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentBaseVersionPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentBaseResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-admin-data:endre",
              "consents-admin-data-global:endre"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    },
    "/client/given-consents/{customerNumber}/by-customer-number": {
      "get": {
        "tags": [
          "Consents client"
        ],
        "summary": "Find all by customer number.",
        "description": "Find all given consents by a customer number.",
        "operationId": "findAllGivenConsentsByCustomerNumber",
        "parameters": [
          {
            "name": "customerNumber",
            "in": "path",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GivenConsentResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          }
        },
        "x-entur-permissions": {
          "value": {
            "any": [
              "consents-customer-data:les",
              "consents-customer-data-global:les"
            ]
          }
        }
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/ET-Client-Name"
        },
        {
          "$ref": "#/components/parameters/X-Correlation-Id"
        }
      ]
    }
  },
  "components": {
    "schemas": {
      "ErrorMessage": {
        "required": [
          "errorCode",
          "longEnglish",
          "longNorwegian",
          "shortEnglish",
          "shortNorwegian"
        ],
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "integer",
            "description": "The error code.",
            "format": "int32"
          },
          "longEnglish": {
            "type": "string",
            "description": "Long error message (English)."
          },
          "shortEnglish": {
            "type": "string",
            "description": "Short error message (English)."
          },
          "longNorwegian": {
            "type": "string",
            "description": "Long error message (Norwegian)."
          },
          "shortNorwegian": {
            "type": "string",
            "description": "Short error message (Norwegian)."
          }
        },
        "description": "ErrorMessage"
      },
      "ConsentRequest": {
        "required": [
          "consentCode",
          "isEmailSupported",
          "isSmsSupported",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent is valid to. Set the date to deactivate the consent. Can only be set to a date before the consent base validTo. If not set the consent is active from validFrom and forever after.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "validFrom": {
            "type": "string",
            "description": "If set, the date the consent is valid from. Can only be set to a date after consent base validFrom. If not set, the consent base is in draft mode.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "consentCode": {
            "type": "string",
            "description": "Consent code. Use the consent code + consent base version to identify the consent base",
            "examples": [
              "ENT_INFO_SMS"
            ]
          },
          "isSmsSupported": {
            "type": "boolean",
            "description": "Whether the organisation supports SMS as a contact method",
            "examples": [
              false
            ]
          },
          "organisationId": {
            "type": "integer",
            "description": "The organisation the consent is valid for.",
            "format": "int64"
          },
          "isEmailSupported": {
            "type": "boolean",
            "description": "Whether the organisation supports email as a contact method",
            "examples": [
              true
            ]
          },
          "consentBaseVersion": {
            "type": "integer",
            "description": "Consent base version for adding a consent to a specific version. If not provided, the latest version is used.",
            "format": "int32",
            "examples": [
              1
            ]
          }
        },
        "description": "Adds a consent to a given consent base. "
      },
      "ConsentResponse": {
        "required": [
          "changedAt",
          "consentBase",
          "consentCode",
          "createdAt",
          "id",
          "isEmailSupported",
          "isSmsSupported",
          "organisationId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Consent ID.",
            "format": "int64"
          },
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent is valid to. Set the date to deactivate the consent. Can only be set to a date before the consent base validTo. If not set the consent is active from validFrom and forever after.",
            "format": "date-time"
          },
          "changedAt": {
            "type": "string",
            "description": "When the consent was last changed. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When the consent was created. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "validFrom": {
            "type": "string",
            "description": "If set, the date the consent is valid from. Can only be set to a date after consent base validFrom. If not set, the consent base is in draft mode.",
            "format": "date-time"
          },
          "consentBase": {
            "$ref": "#/components/schemas/ConsentBaseResponse"
          },
          "consentCode": {
            "type": "string",
            "description": "Code  of the consent base"
          },
          "isSmsSupported": {
            "type": "boolean",
            "description": "Whether the organisation supports SMS as a contact method"
          },
          "organisationId": {
            "type": "integer",
            "description": "The organisation the consent is valid for.",
            "format": "int64"
          },
          "isEmailSupported": {
            "type": "boolean",
            "description": "Whether the organisation supports email as a contact method"
          }
        },
        "description": "Consent response, includes the consent base"
      },
      "ConsentBaseRequest": {
        "required": [
          "consentCode",
          "terms"
        ],
        "type": "object",
        "properties": {
          "terms": {
            "type": "array",
            "description": "Consent terms with long and short description in multiple languages. The descriptions can contain MarkDown",
            "items": {
              "$ref": "#/components/schemas/ConsentTermsRequest"
            }
          },
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent base is valid to. Set the date to deactivate the consent. If not set the consent is active from validFrom and onwards.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "validFrom": {
            "type": "string",
            "description": "If set, the date the consent base is valid from. It is not possible to change the terms after this date without creating a new version. If not set, the consent base is in draft mode.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "consentCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Consent code, identifying the consent base. Must be unique within the system, prefixing it with the organisation's code space is advisable tp avoid conflict. Has a maximum length of 20 characters.",
            "examples": [
              "ENT_INFO_SMS"
            ]
          },
          "consentOwnerOrgId": {
            "type": "integer",
            "description": "The organisation that owns the consent. If not set all organisations can use the consent base.\n          |If you're a partner, this will be filled out from your authentication token.\n        ",
            "format": "int64"
          },
          "internalDescription": {
            "type": "array",
            "description": "Internal description, describing the use cases for the consent base",
            "items": {
              "$ref": "#/components/schemas/InternalDescriptionRequest"
            }
          },
          "orgNameSubstitutionPattern": {
            "type": "string",
            "description": "The pattern on which to perform substitution within terms. Facilitates reusable consent bases across organisations.",
            "examples": [
              "[ORG]"
            ]
          }
        },
        "description": "Create new consent base"
      },
      "ConsentCrmResponse": {
        "required": [
          "consentBaseVersion",
          "consentCode",
          "consentId",
          "consentOrganisationId",
          "createdByOrgId",
          "customerNumber",
          "customerRef",
          "givenConsentId"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The customer's email"
          },
          "lineRef": {
            "type": "string",
            "description": "Reference to the customers journey line, in NeTEx format",
            "examples": [
              "VYT:Line:L1"
            ]
          },
          "consentId": {
            "type": "integer",
            "description": "The id of the Consent that has been consented",
            "format": "int64"
          },
          "consentCode": {
            "type": "string",
            "description": "The consent code of the base consent associated with the consent"
          },
          "countryCode": {
            "type": "string",
            "description": "The telephone number country code"
          },
          "customerRef": {
            "type": "string",
            "description": "Customer ref, a unique identifier for the customer within an organisation"
          },
          "toStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey ended, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "fromStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey started, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "createdByOrgId": {
            "type": "integer",
            "description": "The organisation through which the consent was given",
            "format": "int64"
          },
          "customerNumber": {
            "type": "integer",
            "description": "Customer number, a unique identifier for the customer.",
            "format": "int64"
          },
          "givenConsentId": {
            "type": "integer",
            "description": "Given consent id.",
            "format": "int64"
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The customer's telephone number"
          },
          "consentBaseVersion": {
            "type": "integer",
            "description": "The consent base version associated with the consent",
            "format": "int32"
          },
          "consentOrganisationId": {
            "type": "integer",
            "description": "The organisation that owns the Consent. Typically an 'Operatør'",
            "format": "int64"
          },
          "originalDatedServiceJourneyId": {
            "type": "string",
            "description": "Unique Id for a specific Service Journey, in NeTEx format with ENT as operator",
            "examples": [
              "ENT:DatedServiceJourney:12345"
            ]
          }
        },
        "description": "A condensed view of consent information"
      },
      "ConsentBaseResponse": {
        "required": [
          "changedAt",
          "consentCode",
          "createdAt",
          "terms",
          "version"
        ],
        "type": "object",
        "properties": {
          "terms": {
            "type": "array",
            "description": "Consent terms with long and short description in multiple languages. The descriptions can contain MarkDown",
            "items": {
              "$ref": "#/components/schemas/ConsentTermsResponse"
            }
          },
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent base is valid to. If this date is in the past, the consent base is deactivated. If not set, the consent is active from validFrom and onwards.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "version": {
            "type": "integer",
            "description": "The consent base version",
            "format": "int32"
          },
          "changedAt": {
            "type": "string",
            "description": "When the consent base was last changed. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When the consent base was created. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "validFrom": {
            "type": "string",
            "description": "If set, the date the consent base is valid from. It is not possible to change the consent terms after this date without creating a new version. If not set, the consent base is in draft mode.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "consentCode": {
            "type": "string",
            "description": "Consent code used to identify the consent base",
            "examples": [
              "ENT_INFO_SMS"
            ]
          },
          "consentOwnerOrgId": {
            "type": "integer",
            "description": "The organisation that owns the consent base. If not set, the consent base can be used by all organisations.",
            "format": "int64"
          },
          "internalDescription": {
            "type": "array",
            "description": "Internal description, describing the use cases for the consent base",
            "items": {
              "$ref": "#/components/schemas/InternalDescriptionResponse"
            }
          },
          "orgNameSubstitutionPattern": {
            "type": "string",
            "description": "The pattern on which to perform substitution within terms. Facilitates reusable consent basess across organisations",
            "examples": [
              "[ORG]"
            ]
          }
        },
        "description": "Consent base"
      },
      "ConsentPatchRequest": {
        "type": "object",
        "properties": {
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent is valid to. Set the date to deactivate the consent. If not set the consent is active from validFrom and forever after",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          }
        },
        "description": "Request to set the valid to date for a consent"
      },
      "ConsentTermsRequest": {
        "required": [
          "fullDescription",
          "languageCode",
          "shortDescription"
        ],
        "type": "object",
        "properties": {
          "languageCode": {
            "type": "string",
            "description": "ISO-639-3 languageCode.",
            "examples": [
              "ENG"
            ]
          },
          "fullDescription": {
            "type": "string",
            "description": "Text describing the terms in detail. The text can contain MarkDown"
          },
          "shortDescription": {
            "type": "string",
            "description": "Short text explaining the terms. The text can contain MarkDown"
          }
        },
        "description": "Text for terms in a specific language. Short descriptions should contain enough information to obtain consents, with the long description containing detailed information. "
      },
      "GivenConsentRequest": {
        "required": [
          "consentChoice",
          "consentId",
          "customerNumber",
          "expirationDate"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The contact email provided with the consent.",
            "examples": [
              "example@mail.com"
            ]
          },
          "lineRef": {
            "type": "string",
            "description": "Reference to the customers journey line, in NeTEx format",
            "examples": [
              "VYT:Line:L1"
            ]
          },
          "consentId": {
            "type": "integer",
            "description": "The id of the consent defining what and to whom the customer has consented.",
            "format": "int64",
            "examples": [
              12
            ]
          },
          "countryCode": {
            "type": "string",
            "description": "The telephone number country code provided with the consent",
            "examples": [
              "+47"
            ]
          },
          "customerRef": {
            "type": "string",
            "description": "Customer reference. Note: If you do not provide a customer reference, the customer number will used as reference.",
            "examples": [
              "abcd-1234"
            ]
          },
          "toStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey ended, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "consentChoice": {
            "type": "boolean",
            "description": "Whether this consent has been approved or rejected.",
            "examples": [
              true
            ]
          },
          "fromStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey started, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "customerNumber": {
            "type": "integer",
            "description": "Customer number. ",
            "format": "int64",
            "examples": [
              123456789
            ]
          },
          "expirationDate": {
            "type": "string",
            "description": "When the consent expires. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number provided with the consent",
            "examples": [
              "87654321"
            ]
          },
          "originalDatedServiceJourneyId": {
            "type": "string",
            "description": "Unique Id for a specific Service Journey, in NeTEx format with ENT as operator",
            "examples": [
              "ENT:DatedServiceJourney:12345"
            ]
          }
        },
        "description": "Create a given consent for a customer"
      },
      "ConsentTermsResponse": {
        "required": [
          "fullDescription",
          "languageCode",
          "shortDescription"
        ],
        "type": "object",
        "properties": {
          "languageCode": {
            "type": "string",
            "description": "ISO-639-3 language code. 3 characters",
            "examples": [
              "ENG"
            ]
          },
          "fullDescription": {
            "type": "string",
            "description": "Text describing the terms in detail. The text can contain MarkDown"
          },
          "shortDescription": {
            "type": "string",
            "description": "Short text explaining the terms. The text can contain MarkDown"
          }
        },
        "description": "Text for terms in a specific language"
      },
      "GivenConsentResponse": {
        "required": [
          "changedAt",
          "consent",
          "consentChoice",
          "consentId",
          "createdAt",
          "createdByOrgId",
          "customerNumber",
          "distributionChannel",
          "expirationDate",
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique id for the given consent.",
            "format": "int64"
          },
          "email": {
            "type": "string",
            "description": "The contact email provided with the consent."
          },
          "consent": {
            "$ref": "#/components/schemas/ConsentResponse"
          },
          "lineRef": {
            "type": "string",
            "description": "Reference to the customers journey line, in NeTEx format",
            "examples": [
              "VYT:Line:L1"
            ]
          },
          "changedAt": {
            "type": "string",
            "description": "When the consent was last changed. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "consentId": {
            "type": "integer",
            "description": "The id of the consent defining what the customer has consented.",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "description": "When the consent was given. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "countryCode": {
            "type": "string",
            "description": "The telephone number country code provided with the consent"
          },
          "customerRef": {
            "type": "string",
            "description": "Customer reference. External reference, unique within an organisation"
          },
          "toStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey ended, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "consentChoice": {
            "type": "boolean",
            "description": "Whether this consent has been approved or rejected."
          },
          "fromStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey started, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "createdByOrgId": {
            "type": "integer",
            "description": "The organisation through which the consent was given",
            "format": "int64"
          },
          "customerNumber": {
            "type": "integer",
            "description": "Customer number. Entur number unique across organisations",
            "format": "int64"
          },
          "expirationDate": {
            "type": "string",
            "description": "When the consent expires. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number provided with the consent"
          },
          "distributionChannel": {
            "type": "string",
            "description": "Distribution channel through which the consent was given."
          },
          "originalDatedServiceJourneyId": {
            "type": "string",
            "description": "Unique Id for a specific Service Journey, in NeTEx format",
            "examples": [
              "ENT:DatedServiceJourney:12345"
            ]
          }
        },
        "description": "A consent given for a customer"
      },
      "GivenConsentPutRequest": {
        "required": [
          "consentChoice",
          "expirationDate"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The contact email provided with the consent.",
            "examples": [
              "example@mail.com"
            ]
          },
          "lineRef": {
            "type": "string",
            "description": "Reference to the customers journey line, in NeTEx format",
            "examples": [
              "VYT:Line:L1"
            ]
          },
          "countryCode": {
            "type": "string",
            "description": "The telephone number country code provided with the consent",
            "examples": [
              "+47"
            ]
          },
          "toStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey ended, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "consentChoice": {
            "type": "boolean",
            "description": "Whether this consent has been approved or rejected.",
            "examples": [
              true
            ]
          },
          "fromStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey started, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "expirationDate": {
            "type": "string",
            "description": "When the consent expires. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number provided with the consent",
            "examples": [
              "87654321"
            ]
          },
          "originalDatedServiceJourneyId": {
            "type": "string",
            "description": "Unique Id for a specific Service Journey, in NeTEx format with ENT as operator",
            "examples": [
              "ENT:DatedServiceJourney:12345"
            ]
          }
        },
        "description": "Update a given consent"
      },
      "ConsentBaseVersionRequest": {
        "required": [
          "terms"
        ],
        "type": "object",
        "properties": {
          "terms": {
            "type": "array",
            "description": "Consent description and terms in multiple languages. Supports MarkDown",
            "items": {
              "$ref": "#/components/schemas/ConsentTermsRequest"
            }
          },
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent base id valid to. Set the date to deactivate the consent. If not set the consent is active from validFrom and forever after",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "validFrom": {
            "type": "string",
            "description": "The date the consent base is valid from. It is not possible to change the consent terms after this date without creating a new version. If not set the consent is in draft mode.",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "internalDescription": {
            "type": "array",
            "description": "Internal description, describing what the usecases are for the consent",
            "items": {
              "$ref": "#/components/schemas/InternalDescriptionRequest"
            }
          },
          "orgNameSubstitutionPattern": {
            "type": "string",
            "description": "The pattern on which to perform substitution within consentDescription and consentTerms. Facilitates reusable consents across organisations.",
            "examples": [
              "[ORG]"
            ]
          }
        },
        "description": "Request body for updating a consent base in draft mode or creating a new version of a consent base."
      },
      "GivenConsentBulkGetRequest": {
        "type": "object",
        "properties": {
          "customerRefs": {
            "type": "array",
            "description": "Customer references to look up.",
            "items": {
              "type": "string",
              "description": "Customer references to look up."
            }
          },
          "customerNumbers": {
            "type": "array",
            "description": "Customer numbers to look up.",
            "items": {
              "type": "integer",
              "description": "Customer numbers to look up.",
              "format": "int64"
            }
          }
        },
        "description": "Request to get given consents for multiple customers by customer numbers or customer references."
      },
      "InternalDescriptionRequest": {
        "required": [
          "languageCode"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "A description for the partner administrating consents. If the request is an update and this is set to null, the description for the language will be deleted"
          },
          "languageCode": {
            "type": "string",
            "description": "ISO-639-3 languageCode. 3 characters",
            "examples": [
              "ENG"
            ]
          }
        },
        "description": "Contains internal description for a consent. Will not be shown to a customer"
      },
      "InternalDescriptionResponse": {
        "required": [
          "description",
          "languageCode"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "A description for the partner administrating consents"
          },
          "languageCode": {
            "type": "string",
            "description": "ISO-639-3 language code. 3 characters",
            "examples": [
              "ENG"
            ]
          }
        },
        "description": "Contains internal description for a consent. Will not be shown to customer"
      },
      "GivenConsentBulkUpdateRequest": {
        "required": [
          "consentChoice",
          "consentId",
          "customerNumber",
          "expirationDate"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The contact email provided with the consent.",
            "examples": [
              "example@mail.com"
            ]
          },
          "lineRef": {
            "type": "string",
            "description": "Reference to the customers journey line, in NeTEx format",
            "examples": [
              "VYT:Line:L1"
            ]
          },
          "consentId": {
            "type": "integer",
            "description": "The id of the consent defining what and to whom the customer has consented.",
            "format": "int64",
            "examples": [
              12
            ]
          },
          "countryCode": {
            "type": "string",
            "description": "The telephone number country code provided with the consent",
            "examples": [
              "+47"
            ]
          },
          "customerRef": {
            "type": "string",
            "description": "Customer reference. Note: If you do not provide a customer ref, the customer number will used as reference.",
            "examples": [
              "abcd-1234"
            ]
          },
          "toStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey ended, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "consentChoice": {
            "type": "boolean",
            "description": "Whether this consent has been approved or rejected.",
            "examples": [
              true
            ]
          },
          "fromStopPlace": {
            "type": "string",
            "description": "The stop place where the customer’s journey started, in NeTEx format.",
            "examples": [
              "NSR:StopPlace:12345"
            ]
          },
          "customerNumber": {
            "type": "integer",
            "description": "The customer number ",
            "format": "int64",
            "examples": [
              123456789
            ]
          },
          "expirationDate": {
            "type": "string",
            "description": "When the consent expires. ISO 8601 date format",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number provided with the consent",
            "examples": [
              "87654321"
            ]
          },
          "originalDatedServiceJourneyId": {
            "type": "string",
            "description": "Unique Id for a specific Service Journey, in NeTEx format with ENT as operator",
            "examples": [
              "ENT:DatedServiceJourney:12345"
            ]
          }
        },
        "description": "Request to bulk update given consents for a customer. Adds a new given consent or replaces any existing given consent identified by the consent ID."
      },
      "ConsentBaseVersionPatchRequest": {
        "type": "object",
        "properties": {
          "terms": {
            "type": "array",
            "description": "Terms to add. Only new languages can be added to existing terms. Updating terms for an existing language will result in an exception.",
            "items": {
              "$ref": "#/components/schemas/ConsentTermsRequest"
            }
          },
          "validTo": {
            "type": "string",
            "description": "If set, the date the consent base is valid to. Set the date to deactivate the consent base. If not set, the consent base is active from validFrom and onwards",
            "format": "date-time",
            "examples": [
              "2019-04-05T14:30:30+02:00"
            ]
          },
          "internalDescription": {
            "type": "array",
            "description": "The internal description. Is only exposed for admin endpoints",
            "items": {
              "$ref": "#/components/schemas/InternalDescriptionRequest"
            }
          }
        },
        "description": "Request to update updatable fields after the consent base is active"
      }
    },
    "responses": {
      "Error400": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "Error401": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "Error403": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "Error404": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      },
      "Error500": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMessage"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "parameters": {
      "ET-Client-Name": {
        "in": "header",
        "name": "ET-Client-Name",
        "description": "\nEntur Client Header.\nIt is required that all consumers identify themselves by using this header.\nEntur will deploy strict rate-limiting policies on API-consumers who do not identify with a header and reserves the right to block unidentified consumers.\nThe structure of ET-Client-Name should be: `<company>-<application>` for companies, and `<personal name>-<application>` for individuals.",
        "schema": {
          "type": "string"
        }
      },
      "X-Correlation-Id": {
        "in": "header",
        "name": "X-Correlation-Id",
        "description": "Correlation id",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}