---
title: "Create consent"
method: POST
path: "/v1/consents"
tags: ["Account Information Service (AIS)"]
---

# Create consent

`POST /v1/consents`

This method create a consent resource, defining access rights to dedicated accounts of 
a given PSU-ID. These accounts are addressed explicitly in the method as 
parameters as a core function.

**Side Effects**
When this consent request is a request where the "recurringIndicator" equals "true",
and if it exists already a former consent for recurring access on account information 
for the addressed PSU, then the former consent automatically expires as soon as the new 
consent request is authorised by the PSU.

Optional Extension:
As an option, an ASPSP might optionally accept a specific access right on the access on all PSD2 related services for all available accounts.

As another option an ASPSP might optionally also accept a command, where only access rights are inserted without mentioning the addressed account. 
The relation to accounts is then handled afterwards between PSU and ASPSP. 
This option is not supported for the Embedded SCA Approach. 
As a last option, an ASPSP might in addition accept a command with access rights
  * to see the list of available payment accounts or
  * to see the list of available payment accounts with balances.

## Headers

- `X-Request-ID` string, required
- `Digest` string
- `Signature` string
- `TPP-Signature-Certificate` string, byte
- `PSU-ID` string
- `PSU-ID-Type` string
- `PSU-Corporate-ID` string
- `PSU-Corporate-ID-Type` string
- `TPP-Redirect-Preferred` boolean
- `TPP-Redirect-URI` string, uri
- `TPP-Nok-Redirect-URI` string, uri
- `TPP-Explicit-Authorisation-Preferred` boolean
- `TPP-Brand-Logging-Information` string
- `TPP-Notification-URI` string
- `TPP-Notification-Content-Preferred` string
- `PSU-IP-Port` string
- `PSU-IP-Address` string, ipv4, required
- `PSU-Accept` string
- `PSU-Accept-Charset` string
- `PSU-Accept-Encoding` string
- `PSU-Accept-Language` string
- `PSU-User-Agent` string
- `PSU-Http-Method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
- `PSU-Device-ID` string
- `PSU-Geo-Location` string

## Request body

- Consents — Content of the body of a consent request.
  - `access` AccountAccess, required — Requested access services for a consent.
    - `accounts` AccountReference16CH[] — Is asking for detailed account information. If the array is empty in a request, the TPP is asking for an accessible account list. This may be restricted in a PSU/ASPSP authorization dialogue. If the array is empty, also the arrays for balances, additionalInformation sub attributes or transactions shall be empty, if used.
      - `iban` string — IBAN of an account.
      - `otherAccountIdentification` string — Other payment account Identifier. adapted from ISO pain.001.001.03.ch.02 GenericAccountIdentification1-CH
      - `currency` string — ISO 4217 Alpha 3 currency code.
      - `cashAccountType` string — ExternalCashAccountType1Code from ISO 20022.
    - `balances` AccountReference16CH[] — Is asking for balances of the addressed accounts. If the array is empty in the request, the TPP is asking for the balances of all accessible account lists. This may be restricted in a PSU/ASPSP authorization dialogue. If the array is empty, also the arrays for accounts, additionalInformation sub attributes or transactions shall be empty, if used.
      - `iban` string — IBAN of an account.
      - `otherAccountIdentification` string — Other payment account Identifier. adapted from ISO pain.001.001.03.ch.02 GenericAccountIdentification1-CH
      - `currency` string — ISO 4217 Alpha 3 currency code.
      - `cashAccountType` string — ExternalCashAccountType1Code from ISO 20022.
    - `transactions` AccountReference16CH[] — Is asking for transactions of the addressed accounts. If the array is empty in the request, the TPP is asking for the transactions of all accessible account lists. This may be restricted in a PSU/ASPSP authorization dialogue. If the array is empty, also the arrays for accounts, additionalInformation sub attributes or balances shall be empty, if used.
      - `iban` string — IBAN of an account.
      - `otherAccountIdentification` string — Other payment account Identifier. adapted from ISO pain.001.001.03.ch.02 GenericAccountIdentification1-CH
      - `currency` string — ISO 4217 Alpha 3 currency code.
      - `cashAccountType` string — ExternalCashAccountType1Code from ISO 20022.
    - `additionalInformation` AdditionalInformationAccess — Optional if supported by API provider. Is asking for additional information as added within this structured object. The usage of this data element requires at least one of the entries "accounts", "transactions" or "balances" also to be contained in the object. If detailed accounts are referenced, it is required in addition that any account addressed within the additionalInformation attribute is also addressed by at least one of the attributes "accounts", "transactions" or "balances".
      - `ownerName` AccountReference16CH[] — Is asking for account owner name of the accounts referenced within. If the array is empty in the request, the TPP is asking for the account owner name of all accessible accounts. This may be restricted in a PSU/ASPSP authorization dialogue. If the array is empty, also the arrays for accounts, balances or transactions shall be empty, if used. The ASPSP will indicate in the consent resource after a successful authorisation, whether the ownerName consent can be accepted by providing the accounts on which the ownerName will be delivered. This array can be empty.
        - `iban` string — IBAN of an account.
        - `otherAccountIdentification` string — Other payment account Identifier. adapted from ISO pain.001.001.03.ch.02 GenericAccountIdentification1-CH
        - `currency` string — ISO 4217 Alpha 3 currency code.
        - `cashAccountType` string — ExternalCashAccountType1Code from ISO 20022.
      - `trustedBeneficiaries` AccountReference16CH[] — Optional if supported by API provider. Is asking for the trusted beneficiaries related to the accounts referenced within and related to the PSU. If the array is empty in the request, the TPP is asking for the lists of trusted beneficiaries of all accessible accounts. This may be restricted in a PSU/ASPSP authorization dialogue by the PSU if also the account lists addressed by the tags “accounts”, “balances” or “transactions” are empty. The ASPSP will indicate in the consent resource after a successful authorisation, whether the trustedBeneficiaries consent can be accepted by providing the accounts on which the list of trusted beneficiaries will be delivered. This array can be empty.
        - `iban` string — IBAN of an account.
        - `otherAccountIdentification` string — Other payment account Identifier. adapted from ISO pain.001.001.03.ch.02 GenericAccountIdentification1-CH
        - `currency` string — ISO 4217 Alpha 3 currency code.
        - `cashAccountType` string — ExternalCashAccountType1Code from ISO 20022.
    - `availableAccounts` 'allAccounts' | 'allAccountsWithOwnerName' — Optional if supported by API provider. The values "allAccounts" and "allAccountsWithOwnerName" are admitted. The support of the "allAccountsWithOwnerName" value by the ASPSP is optional.
    - `availableAccountsWithBalance` 'allAccounts' | 'allAccountsWithOwnerName' — Optional if supported by API provider. The values "allAccounts" and "allAccountsWithOwnerName" are admitted. The support of the "allAccountsWithOwnerName" value by the ASPSP is optional.
    - `allPsd2` 'allAccounts' | 'allAccountsWithOwnerName' — Optional if supported by API provider. The values "allAccounts" and "allAccountsWithOwnerName" are admitted. The support of the "allAccountsWithOwnerName" value by the ASPSP is optional.
    - `restrictedTo` CashAccountType[] — If the TPP requests access to accounts via availableAccounts (List of available accounts), global or bank driven consents, the TPP may include this element to restrict access to the referred account types. Absence of the element is interpreted as "no restriction" (therefore access to accounts of all types is requested). The element may only occur, if each of the elements - accounts - balances - transactions is either not present or contains an empty array.
  - `recurringIndicator` boolean, required — "true", if the consent is for recurring access to the account data. "false", if the consent is for one access to the account data.
  - `validUntil` string, date, required — This parameter is defining a valid until date (including the mentioned date) for the requested consent. The content is the local ASPSP date in ISO-Date format, e.g. 2017-10-30. Future dates might get adjusted by ASPSP. If a maximal available date is requested, a date in far future is to be used: "9999-12-31". In both cases the consent object to be retrieved by the get consent request will contain the adjusted date.
  - `frequencyPerDay` integer, required — This field indicates the requested maximum frequency for an access without PSU involvement per day. For a one-off access, this attribute is set to "1". The frequency needs to be greater equal to one. If not otherwise agreed bilaterally between TPP and ASPSP, the frequency is less equal to 4.
  - `combinedServiceIndicator` boolean, required — If "true" indicates that a payment initiation service will be addressed in the same "session".

## Response `201`

Created

- ConsentsResponse201 — Body of the JSON response for a successful consent request.
  - `consentStatus` 'received' | 'rejected' | 'valid' | 'revokedByPsu' | 'expired' | 'terminatedByTpp' | 'partiallyAuthorised', required — This is the overall lifecycle status of the consent. Valid values are: - 'received': The consent data have been received and are technically correct. The data is not authorised yet. - 'rejected': The consent data have been rejected e.g. since no successful authorisation has taken place. - 'valid': The consent is accepted and valid for GET account data calls and others as specified in the consent object. - 'revokedByPsu': The consent has been revoked by the PSU towards the ASPSP. - 'expired': The consent expired. - 'terminatedByTpp': The corresponding TPP has terminated the consent by applying the DELETE method to the consent resource. - 'partiallyAuthorised': The consent is due to a multi-level authorisation, some but not all mandated authorisations have been performed yet. The ASPSP might add further codes. These codes then shall be contained in the ASPSP's documentation of the XS2A interface and has to be added to this API definition as well.
  - `consentId` string, required — ID of the corresponding consent object as returned by an account information consent request.
  - `scaMethods` AuthenticationObject[] — This data element might be contained, if SCA is required and if the PSU has a choice between different authentication methods. Depending on the risk management of the ASPSP this choice might be offered before or after the PSU has been identified with the first relevant factor, or if an access token is transported. If this data element is contained, then there is also a hyperlink of type 'startAuthorisationWithAuthenticationMethodSelection' contained in the response body. These methods shall be presented towards the PSU for selection by the TPP.
    - `authenticationType` 'SMS_OTP' | 'CHIP_OTP' | 'PHOTO_OTP' | 'PUSH_OTP' | 'SMTP_OTP', required — Type of the authentication method. More authentication types might be added during implementation projects and documented in the ASPSP documentation. - 'SMS_OTP': An SCA method, where an OTP linked to the transaction to be authorised is sent to the PSU through a SMS channel. - 'CHIP_OTP': An SCA method, where an OTP is generated by a chip card, e.g. a TOP derived from an EMV cryptogram. To contact the card, the PSU normally needs a (handheld) device. With this device, the PSU either reads the challenging data through a visual interface like flickering or the PSU types in the challenge through the device key pad. The device then derives an OTP from the challenge data and displays the OTP to the PSU. - 'PHOTO_OTP': An SCA method, where the challenge is a QR code or similar encoded visual data which can be read in by a consumer device or specific mobile app. The device resp. the specific app than derives an OTP from the visual challenge data and displays the OTP to the PSU. - 'PUSH_OTP': An OTP is pushed to a dedicated authentication APP and displayed to the PSU. - 'SMTP_OTP': An OTP is sent via email to the PSU.
    - `authenticationVersion` string — Depending on the "authenticationType". This version can be used by differentiating authentication tools used within performing OTP generation in the same authentication type. This version can be referred to in the ASPSP?s documentation.
    - `authenticationMethodId` string, required — An identification provided by the ASPSP for the later identification of the authentication method selection.
    - `name` string — This is the name of the authentication method defined by the PSU in the Online Banking frontend of the ASPSP. Alternatively this could be a description provided by the ASPSP like "SMS OTP on phone +49160 xxxxx 28". This name shall be used by the TPP when presenting a list of authentication methods to the PSU, if available.
    - `explanation` string — Detailed information about the SCA method for the PSU.
  - `chosenScaMethod` ChosenScaMethod — Authentication object.
    - `authenticationType` 'SMS_OTP' | 'CHIP_OTP' | 'PHOTO_OTP' | 'PUSH_OTP' | 'SMTP_OTP', required — Type of the authentication method. More authentication types might be added during implementation projects and documented in the ASPSP documentation. - 'SMS_OTP': An SCA method, where an OTP linked to the transaction to be authorised is sent to the PSU through a SMS channel. - 'CHIP_OTP': An SCA method, where an OTP is generated by a chip card, e.g. a TOP derived from an EMV cryptogram. To contact the card, the PSU normally needs a (handheld) device. With this device, the PSU either reads the challenging data through a visual interface like flickering or the PSU types in the challenge through the device key pad. The device then derives an OTP from the challenge data and displays the OTP to the PSU. - 'PHOTO_OTP': An SCA method, where the challenge is a QR code or similar encoded visual data which can be read in by a consumer device or specific mobile app. The device resp. the specific app than derives an OTP from the visual challenge data and displays the OTP to the PSU. - 'PUSH_OTP': An OTP is pushed to a dedicated authentication APP and displayed to the PSU. - 'SMTP_OTP': An OTP is sent via email to the PSU.
    - `authenticationVersion` string — Depending on the "authenticationType". This version can be used by differentiating authentication tools used within performing OTP generation in the same authentication type. This version can be referred to in the ASPSP?s documentation.
    - `authenticationMethodId` string, required — An identification provided by the ASPSP for the later identification of the authentication method selection.
    - `name` string — This is the name of the authentication method defined by the PSU in the Online Banking frontend of the ASPSP. Alternatively this could be a description provided by the ASPSP like "SMS OTP on phone +49160 xxxxx 28". This name shall be used by the TPP when presenting a list of authentication methods to the PSU, if available.
    - `explanation` string — Detailed information about the SCA method for the PSU.
  - `challengeData` ChallengeData — It is contained in addition to the data element 'chosenScaMethod' if challenge data is needed for SCA. In rare cases this attribute is also used in the context of the 'startAuthorisationWithPsuAuthentication' link.
    - `image` string, byte — PNG data (max. 512 kilobyte) to be displayed to the PSU, Base64 encoding, cp. [RFC4648]. This attribute is used only, when PHOTO_OTP or CHIP_OTP is the selected SCA method.
    - `data` string[] — A collection of strings as challenge data.
    - `imageLink` string — A link where the ASPSP will provides the challenge image for the TPP.
    - `otpMaxLength` integer — The maximal length for the OTP to be typed in by the PSU.
    - `otpFormat` 'characters' | 'integer' — The format type of the OTP to be typed in. The admitted values are "characters" or "integer".
    - `additionalInformation` string — Additional explanation for the PSU to explain e.g. fallback mechanism for the chosen SCA method. The TPP is obliged to show this to the PSU.
  - `_links` LinksConsents, required — A list of hyperlinks to be recognised by the TPP. Type of links admitted in this response (which might be extended by single ASPSPs as indicated in its XS2A documentation): * 'scaRedirect': In case of an SCA Redirect Approach, the ASPSP is transmitting the link to which to redirect the PSU browser. * 'scaOAuth': In case of an OAuth2 based Redirect Approach, the ASPSP is transmitting the link where the configuration of the OAuth2 Server is defined. The configuration follows the OAuth 2.0 Authorisation Server Metadata specification. * 'confirmation': Might be added by the ASPSP if either the "scaRedirect" or "scaOAuth" hyperlink is returned in the same response message. This hyperlink defines the URL to the resource which needs to be updated with * a confirmation code as retrieved after the plain redirect authentication process with the ASPSP authentication server or * an access token as retrieved by submitting an authorization code after the integrated OAuth based authentication process with the ASPSP authentication server. * 'startAuthorisation': In case, where an explicit start of the transaction authorisation is needed, but no more data needs to be updated (no authentication method to be selected, no PSU identification nor PSU authentication data to be uploaded). * 'startAuthorisationWithPsuIdentification': The link to the authorisation end-point, where the authorisation sub-resource has to be generated while uploading the PSU identification data. * 'startAuthorisationWithPsuAuthentication': The link to the authorisation end-point, where the authorisation sub-resource has to be generated while uploading the PSU authentication data. * 'startAuthorisationWithEncryptedPsuAuthentication': Same as startAuthorisactionWithPsuAuthentication where the authentication data need to be encrypted on application layer in uploading. * 'startAuthorisationWithAuthenticationMethodSelection': The link to the authorisation end-point, where the authorisation sub-resource has to be generated while selecting the authentication method. This link is contained under exactly the same conditions as the data element 'scaMethods' * 'startAuthorisationWithTransactionAuthorisation': The link to the authorisation end-point, where the authorisation sub-resource has to be generated while authorising the transaction e.g. by uploading an OTP received by SMS. * 'self': The link to the Establish Account Information Consent resource created by this request. This link can be used to retrieve the resource data. * 'status': The link to retrieve the status of the account information consent. * 'scaStatus': The link to retrieve the scaStatus of the corresponding authorisation sub-resource. This link is only contained, if an authorisation sub-resource has been already created.
    - `scaRedirect` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `scaOAuth` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `confirmation` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisation` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisationWithPsuIdentification` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisationWithPsuAuthentication` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisationWithEncryptedPsuAuthentication` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisationWithAuthenticationMethodSelection` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `startAuthorisationWithTransactionAuthorisation` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `self` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `status` HrefType — Link to a resource.
      - `href` string — Link to a resource.
    - `scaStatus` HrefType — Link to a resource.
      - `href` string — Link to a resource.
  - `psuMessage` string — Text to be displayed to the PSU.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `405` — Method Not Allowed
- `406` — Not Acceptable
- `408` — Request Timeout
- `409` — Conflict
- `415` — Unsupported Media Type
- `429` — Too Many Requests
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/openbankingproject-ch/apis/swiss-nextgen-banking-api-framework.md) · [All operations](https://skmtc.net/openbankingproject-ch/apis/swiss-nextgen-banking-api-framework/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openbankingproject-ch/swiss-nextgen-banking-api-framework/revisions/c32e86db40b4/schema)
