openapi: 3.2.0 info: title: KYC Tenure Check Subscriber Tenure API description: '# Summary The CAMARA Know Your Customer (KYC) Tenure API allows for verification that a network subscriber has been a customer of the Communications Service Provider (CSP) for a specified minimum length of time so as to establish a level of trust for the associated network subscription identifier.' version: 0.2.0 x-camara-commonalities: 0.6 license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html servers: - url: '{apiRoot}/kyc-tenure/v0.2' variables: apiRoot: default: https://localhost:9091 description: API root tags: - name: Check Subscriber Tenure description: Check details about the length of tenure of the subscriber paths: /check-tenure: post: tags: - Check Subscriber Tenure summary: The KYC Tenure service API description: Verifies a specified length of tenure, based on a provided date, for a network subscriber to establish a level of trust for the network subscription identifier. security: - openId: - kyc-tenure:check-tenure operationId: checkTenure parameters: - in: header name: x-correlator description: Correlation id for the different services required: false schema: $ref: '#/components/schemas/XCorrelator' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Tenure' responses: '200': description: Respond with tenure information headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: $ref: '#/components/schemas/TenureInfo' '400': $ref: '#/components/responses/Generic400' '401': $ref: '#/components/responses/Generic401' '403': $ref: '#/components/responses/Generic403' '404': $ref: '#/components/responses/Generic404' '422': $ref: '#/components/responses/Generic422' components: responses: Generic404: description: Not found headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorInfo' - type: object properties: status: enum: - 404 code: enum: - IDENTIFIER_NOT_FOUND examples: GENERIC_404_IDENTIFIER_NOT_FOUND: description: The phone number is not associated with a CSP customer account value: status: 404 code: IDENTIFIER_NOT_FOUND message: The phone number provided is not associated with a customer account Generic403: description: Forbidden headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorInfo' - type: object properties: status: enum: - 403 code: enum: - PERMISSION_DENIED examples: GENERIC_403_PERMISSION_DENIED: description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security value: status: 403 code: PERMISSION_DENIED message: Client does not have sufficient permissions to perform this action. Generic422: description: Unprocessable Content headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorInfo' - type: object properties: status: enum: - 422 code: enum: - SERVICE_NOT_APPLICABLE - MISSING_IDENTIFIER - UNNECESSARY_IDENTIFIER examples: GENERIC_422_SERVICE_NOT_APPLICABLE: description: Service is not applicable for the provided phone number value: status: 422 code: SERVICE_NOT_APPLICABLE message: The service is not applicable for the provided phone number GENERIC_422_MISSING_IDENTIFIER: description: No phone number has been provided either explicitly or associated with the access token value: status: 422 code: MISSING_IDENTIFIER message: No phone number has been provided GENERIC_422_UNNECESSARY_IDENTIFIER: description: An explicit phone number has been provided when one is already associated with the access token value: status: 422 code: UNNECESSARY_IDENTIFIER message: An explicit phone number has been provided when one is already associated with the access token Generic401: description: Unauthorized headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorInfo' - type: object properties: status: enum: - 401 code: enum: - UNAUTHENTICATED examples: GENERIC_401_UNAUTHENTICATED: description: Request cannot be authenticated and a new authentication is required value: status: 401 code: UNAUTHENTICATED message: Request not authenticated due to missing, invalid, or expired credentials. A new authentication is required. Generic400: description: Bad Request headers: x-correlator: $ref: '#/components/headers/X-Correlator' content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorInfo' - type: object properties: status: enum: - 400 code: enum: - INVALID_ARGUMENT - OUT_OF_RANGE examples: GENERIC_400_INVALID_ARGUMENT: description: Invalid Argument. Generic Syntax Exception value: status: 400 code: INVALID_ARGUMENT message: Client specified an invalid argument, request body or query param. GENERIC_400_OUT_OF_RANGE: description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested value: status: 400 code: OUT_OF_RANGE message: Client specified an invalid range. schemas: ErrorInfo: type: object required: - status - code - message properties: status: type: integer description: HTTP response status code code: type: string description: A human-readable code to describe the error message: type: string description: A human-readable description of what the event represents TenureInfo: properties: tenureDateCheck: description: '`true` when the identified mobile subscription has had valid tenure since `tenureDate`, otherwise `false` ' example: true type: boolean contractType: description: 'If exists, populated with: - `PAYG` - prepaid (pay-as-you-go) account - `PAYM` - contract account - `Business` - Business (enterprise) account This attribute may be omitted from the response set if the information is not available ' example: PAYM type: string enum: - PAYG - PAYM - Business required: - tenureDateCheck PhoneNumber: description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. type: string pattern: ^\+[1-9][0-9]{4,14}$ example: '+123456789' XCorrelator: type: string pattern: ^[a-zA-Z0-9-_:;.\/<>{}]{0,256}$ example: b4333c46-49c0-4f62-80d7-f0ef930f1c46 Tenure: description: Specifies date from which continuous tenure of the identified mobile subscriber is required to be confirmed type: object properties: phoneNumber: $ref: '#/components/schemas/PhoneNumber' tenureDate: type: string description: The date, in RFC 3339 / ISO 8601 compliant format "YYYY-MM-DD", from which continuous tenure of the identified network subscriber is required to be confirmed format: date example: '2023-07-03' required: - tenureDate headers: X-Correlator: description: Correlation id for the different services required: false schema: $ref: '#/components/schemas/XCorrelator' securitySchemes: openId: type: openIdConnect openIdConnectUrl: https://example.com/.well-known/openid-configuration externalDocs: description: Product documentation at CAMARA url: https://github.com/camaraproject/Tenure