SGDex API (1.2.0-release)

Download OpenAPI specification:Download

This API Specification gives an overview of what SGDex is and serves as a guide to help you integrate your application with SGDex.

Note - This specification is subject to changes based on the evolution of the APIs.

INTRODUCTION

This section gives an introduction to SGDex.

What is SGDex?

SGDex stands for "Singapore Data Exchange".

SGDex is a highly-customisable data exchange layer platform that supports multiple data exchanges. In other words, you can use SGDex as a data exchange layer for any platform of your choice.

SGDex is organised around REST and returns JSON-encoded responses with standard HTTP response codes.

How does SGDex work?

SGDex is highly configurable according to your data needs. Each data exchange can customise and configure APIs according to their usage. If an entity in a data exchange wants to send or receive data, they can call one of the pre-configured REST APIs in the data exchange, and the routing is handled by us.

How does SGDex work

The diagram above illustrates how SGDex can support your application. SGDex currently supports Singapore Financial Data Exchange(SGFinDex) and Singapore Trade Data Exchange (SGTraDex).

For example, SGFinDex has an admin portal that directly interacts with the APIs provided by SGDex for configuration and organisational purposes. It also provides a group of internal APIs that can communicate with admin-configured APIs in SGDex. For SGTraDex, they also have a similar design. However, instead of a group of APIs, they provide a pitstop portal for communication between SGDex and SGTraDex.

Each data exchange has isolated configuration tables stored in SGDex to ensure that the configurations in a data exchange would not overwrite or interfere with that of other data exchanges.

Key Roles in a Data Exchange

In every data exchange, there are 3 key roles: Admin, Provider and Consumer.

Key Roles in a Data Exchange
The diagram above illustrates the 3 key roles in a data exchange. The following explains what each role does:
  • Admin: configures and organises the list of APIs, Topics, and Directories within a data exchange

  • Providers: provides data to a data exchange. Providers can manage their:

    • System: pushes data to Consumers
    • Endpoint: allows for Consumers to pull data from a Provider
  • Consumers: consumes data from a data exchange. Consumers can manage their:

    • Client Application: pulls data from Providers
    • Webhook: receives data pushed from Providers

Each role listed above has a specific set of APIs that it can call to interact with the data exchange. Admin, Providers and Consumers generally call APIs used for Organising and Configuring Your Data Exchange. On the other hand, Systems, Endpoints, Client Applications and Webhooks generally call APIs used during the actual Routing .

Organising and Configuring Your Data Exchange

This section explains the configurations and organisations the Admin, Providers and Consumers can make in a data exchange.

Terminology

Listed below are some common terms used when organising a data exchange.

  • API: an endpoint that a Consumer's Client Application in a data exchange can send a request to in order to retrieve data from Providers' Endponts.
  • Topic: an endpoint that a Provider's System in a data exchange can send data to in order to send this data to listening Consumers' Webhooks.
  • Usecase: a group of Topic(s) and API(s) that serve a similar purpose or are part of a similar process.

How to Organise Your Data Exchange

This section illustrates how the terminologies (listed in the previous section) in a data exchange are related. The diagram below shows how APIs, Topics, and Usecases are related.

Data Exchange Structure
As seen in the diagram above, Usecases are used for organising the APIs and Topics in a data exchange. A Usecase will contain all APIs and Topics you can create under a Usecase.

How to Configure Your Data Exchange

With your data exchange created and organised according to your needs, you will then need to configure the API(s) and Topic(s) in your data exchange to behave how you want them to when routing information. In this section, we explain what Scopes, Enrolments and Subscriptions are and how they are related to APIs and Topics.

Scopes

Each OAuth API has a Scope, which is a list of data items that an API can return to a caller when it is called.

Enrolments

An Enrolment is a request by a Provider for its Endpoint or System to be enrolled under an API Service or Topic respectively. There are two kinds of Enrolments:

  • Enroll Endpoint to API: implies that the Provider's Endpoint has committed to providing information listed in the scope of that particular OAuth API that the it has enrolled to.
  • Enroll System to Topic: implies that the Provider's System has committed to sending information to consumers subscribed to this Topic.

Hence, each API can have many Endpoints from different Providers that provide information when it is called. Similarly, each Topic can have many Systems from different Providers that can send information to it to forward to listening Consumers. The diagrams below illustrate this concept.

Enrolment for API Enrolment for Topic
Providers submit these Enrolments as requests and are only able to provide information to an API or Topic once the Admin has approved the request.

Subscriptions

A Subscription is a request by a Consumer for its Client Application(s) and Webhook(s) to subscribe to APIs and Topics respectively under a Directory. A Consumer will subscribe at a Directory level and can choose which API(s) and/or Topic(s) they would like to subscribe to. This means that a Consumer need not subscribe to all APIs and Topics under the chosen Directory.

  • Client Application Subscribe to API: implies that the Client Application would like to have permission to send a request to the API to get data.
  • Consumer Webhook Subscribe to Topic: implies that the Webhook would like to receive data from a Topic when any enrolled Provider System sends data.
Consumers submit Subscriptions as requests and are only able to get information from an API or Topic once the Providers enrolled to that API/Topic have approved their request.

Because each API and Topic may have numerous Providers, each Provider enrolled under an API/Topic that is being subscribed to will receive separate Subscription Requests for them to approve or reject.

A Subscription Request is hence an individual request (a subset of the full Subscription) sent to Providers enrolled under an API or Topic to seek their approval when a Consumer would like to subscribe to the API/Topic they are providing to.

The diagram below illustrates the relationship between a Subscription and Subscription Requests.

Subscription Requests

In the diagram above, a Consumer with Client Application B and Webhook C creates a Subscription request to the API with Endpoint A enrolled and a Topic with System Z enrolled. Because there are 2 Providers, SGDex created 2 separate Subscription Requests to each Provider for their approval to the Subscription.

Data Exchange and Routing

This section illustrates how you can route data in your data exchange from Providers to Consumers. In the previous sections, we focused on configuring the routing rules needed in your data exchange. In this section, we focus on the actual flow of data.

Before you can route data along a specific path (e.g. a Topic) in a data exchange, you must have permission to do so. This permission is granted to Providers and Consumers via the approval of their Enrolment and Subscription requests to that specific path. With no prior approvals, Providers and Consumers are unable to send or receive data from that path in the data exchange.

In routing, there are mainly 2 flows:

  1. Retrieval of Data

    • Synchronous Retrieval

    • Asynchronous Retrieval

  2. Providing of Data

The following sections will illustrate how these flows work in the data exchange.

Retrieval of Data (PULL)

This section illustrates how Consumer Client Applications can retrieve data from Provider Endpoints via an API.

When a Consumer Client Application wants to retrieve data, SGDex calls your pre-defined API in Organising and Configuring Your Data Exchange, which will then fetch data from relevant Provider Endpoints previously enrolled to this API.

Consumer Client Applications can either retrieve data synchronously or asynchronously.

Synchronous Retrieval

Once a request for synchronous retrieval is made, SGDex will fetch data from relevant Provider Endpoints enrolled to this API, consolidate all these data and return them all in one payload to the caller.

More details about the required parameters and return types can be found in ROUTING section. The diagram below illustrates how a Synchronous Retrieval is done.

PULL Flow Sync

Asynchronous Retrieval

Once a request for asynchronous retrieval is made, SGDex will first return an acknowledgement immediately. SGDex will then fetch data from relevant Provider Endpoints enrolled to this API, and send the Provider Endpoints' responses individually to the caller's pre-defined webhook.

More details about the required parameters and return types can be found in ROUTING section. The diagram below illustrates how an Asynchronous Retrieval is done.

PULL Flow Async

Providing of Data (PUSH)

This section illustrates how Provider Systems can send data to Consumer Webhooks via an API. When a Provider System wants to send data, SGDex calls your pre-defined Topic in Organising and Configuring Your Data Exchange, which will then send this data to relevant Consumer Webhooks previously subscribed to this Topic.

More details about the required parameters an return types can be found in ROUTING section. The diagram below illustrates how data is sent to Consumer Webhooks.

PUSH Flow

Delivery Receipts

A unique feature of Providing Data is the presence of delivery receipts. When a Provider System sends data to a Topic with a list of Consumer Webhooks, SGDex will fire the information to each Webhooks individually, and send a Delivery Receipt to a pre-specified Provider Webhook to inform Provider Systems on the status of the deliveries.

Provider Systems can even poll another API to query the status of delivery for their request to send data if they prefer not to receive delivery receipts from their Provider Webhook.

AUTHENTICATION

HTTPS Interface

SGDex API gateway supports accessing of APIs via HTTP over TLS (Transport Layer Security) version 1.2 standards.

Supported Cipher Suites

The list of supported Cipher Suites are as follows:

  • TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
IMPORTANT: Ensure your server supports TLS 1.2 and supports a cipher suite in the list above. Accessing the RESTful APIs using prior versions of TLS and/or unsupported ciphersuites will result in connectivity errors. SGDex API gateway does not support 2-way TLS client nor mutual authentication.

Data Exchange (Client) Authentication

Data Exchange clients (e.g. SGTraDex) must authenticate to SGDex for every request. SGDex uses JWT (specified in RFC 7523) provided in the Authorization header as a bearer token (specified in RFC 6750) for client authentication.

JWT format

Briefly, an unencrypted, signed JWT consists of three parts:

  1. The header;
  2. The body or payload; and
  3. A signature of the payload.

The header may include information about the key and algorithm used to sign the payload. This is needed unless the receiver has obtained this information through other means. As an example, a JWT used for client authentication may have a header and payload like this:

{
  "alg": "ES256",
  "typ": "JWT",
  "kid": "7229075d-972f-4b21-8a0c-38db3a7f2a98"
}
SGDex supports the following token signature algorithms:
  • ES256
  • RS256

The associated payload may look like this:

{
  "aud": "https://api.sgdex.gov.sg",
  "iss": "client-one",
  "sub": "client-one",
  "nbf": 1535806905,
  "exp": 1535810505,
  "iat": 1535806905,
  "jti": "id123456"
}

JWT parameters include the following:

Parameter Name Parameter Value
REQUIRED aud SGDex domain
e.g. https://api.staging-sgdex.gov.sg for staging environment
REQUIRED iss application_id issued by SGDex during onboarding
REQUIRED sub application_id issued by SGDex during onboarding
REQUIRED exp expiration time of token in epoch format - maximum of 5 minutes from time JWT is generated
REQUIRED iat issued at - the time at which the JWT was issued
OPTIONAL nbf not before - the time before which the token MUST NOT be accepted for processing
OPTIONAL jti JWT ID - unique identifier for the token

Signature

  • A JWT must be digitally signed using a private key in asymmetric cryptography (e.g. RS256).
  • A client using the authentication method has to register its public key to SGDex in advance so that the SGDex can verify the token.
NOTE: JWT needs to be signed before being sent to SGDex. Each request's JWT must be unqiue.

Sending JWT in Request

The JWT sent to the SGDex should be a Bearer token in the Authorization header, as described in RFC 6750. A sample request is shown below:

GET /{dex}/{usecase}/{api} HTTP/1.1
Host: stg.api.sgdex.gov.sg
Authorization: Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL3N0Zy5hcGkuc2dkZXguZ292LnNnIiwiaXNzIjoiY2xpZW50LW9uZSIsInN1YiI6ImNsaWVudC1vbmUiLCJuYmYiOjE1MzU4MDY5MDUsImV4cCI6MTUzNTgxMDUwNSwiaWF0IjoxNTM1ODA2OTA1LCJqdGkiOiJpZDEyMzQ1NiJ9.1ba2xgaRfxiu18SBPauA4ibe21uqI1lymtFoYXrFpMysQVADei98guL4QKHqgwD6UwHBOkC_L5W6TR19g1fuoQ

Demonstration of Proof of Possesion (DPoP)

Partner's application is required to generate DPoP Proof JWT to be attached to server-to-server resource calls to prove the legit possession of the access token. (Refer to https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop). The token is signed by partner's ephemeral private signing key, which the partner's public signing key had been used in the token call and "embedded" into the access token provided. Below is a sample of the JWT header and payload of a DPoP token:

  {
    "typ": "dpop+jwt",
    "alg": "ES256",
    "jwk": {
      "kty": "EC",
      "kid": "CRx5jixF8ZLRpxpqguxCwiq0g6b-ACHfQQJT7uiAkio",
      "alg": "ES256",
      "crv": "P-256",
      "x": "mxVK8wvCaQ8iUJ4AyZr1oK1_ceL_27kgTPISNEcChm4",
      "y": "0P-81zpWvcy6YAPSiV_K4h94wdEdk-RwrhbTL0fkeyc"
    }
  }
  . {
    "jti": "dfgsrtsDFBBgbsB230afktmdFGdgegemmet",
    "htu": "https://api.sgdex.gov.sg/sgfindex/api/fpdata/08939d6c-11c0-4bc9-b2cd-f5fd14369521",
    "htm": "GET",
    "iat": 1645757787,
    "exp": 1645757907,
    "ath": "RyPeyISsEqdR1lsZBv80o0A8eF1Kvxdm_uf1hnLRf9M"
  }
  • {typ} Type - Type (Header), value "dpop+jwt"

  • {alg} Algorithm (Header) - digital signature algorithm identifier as per RFC7518 (Refer to https://datatracker.ietf.org/doc/html/rfc7518). MUST NOT be none or an identifier for a symmetric algorithm (MAC).

  • {jwk} JSON Web Key (Header) - public key chosen by the client. MUST NOT contain the private key.

    • {kty} - The family of cryptographic algorithms used with the key

    • {kid} - The unique identifier for the key

    • {alg} - The specific cryptographic algorithm used with the key

    • {crv} - The crv member identifies the cryptographic curve used with the key

    • {x} - The x member contains the x coordinate for the elliptic curve point

    • {y} - The y member contains the y coordinate for the elliptic curve point

  • {jti} JWT ID (Payload) - unique identifier

  • {htu} HTTP URL (Payload) - HTTP URI used for the request, without query (?) and fragment parts (#)

  • {htm} HTTP Method (Payload) - HTTP method for the request to which the JWT is attached

  • {iat} Issued At (Payload) - current timestamp

  • {exp} Expiry (Payload) - expiry timestamp

  • {ath} Access token hash (Payload) - The base64url encoded SHA-256 hash of the ASCII encoding of the associated access token's value

Sample Code in NodeJS that generates the DPoP token

  // function to generate the base64url encoded SHA-256 hash of the ASCII encoding of the accesstoken
  function generateAth(accessToken) {
    let sha256AccessToken =  crypto.createHash('sha256').update(accessToken).digest();
    let base64URLEncodedHash = sha256AccessToken.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
    return base64URLEncodedHash;
  };
  
  // generates DPoP Proof JWT headers for calling **fpdata** API
  async function generateDpopProof  (url, method, sessionPopKeyPair, ath) {
    try {
      let now = Math.floor((Date.now() / 1000));
      let payload = {
        "htu": url,
        "htm": method,
        "jti": generateRandomString(40),
        "iat": now,
        "exp": now + 120,
      };

      // required only for /fpdata resource call
      if(ath)payload.ath = ath; 

      let privateKey = await jose.JWK.asKey(sessionPopKeyPair.privateKey, "pem");
      let jwk = (await jose.JWK.asKey(sessionPopKeyPair.publicKey, "pem")).toJSON(true);;
      jwk.alg = "ES256";
      let jwtToken = await jose.JWS.createSign({ "format": 'compact', "fields": { "typ": 'dpop+jwt', "jwk": jwk } }, { "key": privateKey, "reference": false }).update(JSON.stringify(payload)).final();
      return jwtToken;
    } catch (error) {
      logger.error("generateDpop error", error);
      throw constant.ERROR_GENERATE_DPOP;
    }
  };

Client Assertion

The Partner's application is required to generate client assertions to be attached to server-to-server calls to prove authenticity (Refer to https://datatracker.ietf.org/doc/html/rfc7521). The partner's private key signs the assertion metadata, and SGDex will use the partner's onboarded JWKS endpoint to obtain the public key for verification. Below is a sample of the JWT header and payload of the client assertion:

  {
    "typ": "JWT",
    "alg": "ES256",
    "kid": "x0zDLIC9yNRIXu3gW8nTQDOMNe7sKMAjQnZj3AWTW2U",
  } . {
    "sub": "STG2-APIM-SELF-TEST",
    "jti": "jNDZuyLw66gkTjmCNMawzrTJNlhS8wdjpU0DHTzo",
    "aud": "https://api.staging-sgdex.gov.sg/sgfindex/fpdata/77e0ff15-88be-474a-84ab-5b24ac2fb9d6",
    "iss": "STG2-APIM-SELF-TEST",
    "iat": 1662365106,
    "exp": 1662365406,
    "htm": "POST"
  }

Description of JWT header attributes:

  • {typ} Type - value "JWT"
  • {alg} Algorithm - value "ES256"
  • {kid} Key ID - The unique identifier for the key.

Description of JWT payload attributes:

  • {sub} Subject - client_id issued by SGDex upon onboarding
  • {jti} JWT ID - random unique identifier
  • {aud} Audience - URL that partner's application is calling
  • {iss} Issuer - client_id issued by SGDex upon onboarding
  • {iat} Issued At (Payload) - current timestamp
  • {exp} Expiry (Payload) - expiry timestamp
  • {htm} HTTP Method (Payload) - HTTP method for the request to which the JWT is attached

ERRORS

Error Handling

SGDex uses standard HTTP response codes to indicate the success or failure of each API request. For successful requests, our APIs return 2XX codes. Generally, our HTTP error codes have the following implication:

  • 4XX: Indicates error in the request format, parameters or that your requested items are not found
  • 5XX: Indicates Server errors

The general format of our error responses are as follows:

{
    "code": "integer (int32)",
    "message": "string"
}

List of HTTP Response Codes:

Code Possible Reasons
400 Bad Request
  • Invalid parameters (missing, additional or wrongly formatted)
  • 401 Unauthorised
  • The client_id/system_id mismatched with iss field in JWT token
  • 403 Forbidden
  • No permission to modify an item
  • 404 Not Found
  • Invalid Path Parameters
  • ID given was not found
  • 500 Server Error
  • Unexpected Error
  • Refer to the individual API definitions for the error codes you might encounter for each API.

    ENVIRONMENTS

    Available Environments

    Staging Environment

    This environment allows you to test your application with production-level security requirements, without needing to test your application directly in production.

    The following are some essential information that you might need to test your applications with:

    Production Environment

    The environment where your application will be integrated with SGDex in production.

    The following are some essential information that you might need to test your applications with:

    VERSIONING

    This section mentions all information related to versioning.

    Release Notes

    • 1.2.0-release (27 Jun 2024)

      • Removed organisation concept
      • Removed dex path parameter from application, endpoint, jwks endpoint, webhook. organisation and participant API.
      • Updated update enrolment API to support the update of processing_task array
      • Added create authorisation request API
    • 1.1.0-release (6 Nov 2023)

      • Removed usecase api service concept
      • Removed directory concept
      • API/Topic softlink to usecase only
      • Mandate iat field as mandatory in generated signed JWT
      • Added new resource api
      • Added new supported security mechanism (APIkey) for endpoint
    • 1.0.0-release (20 Jun 2022)

      • Added new scope field to routing api - Retrieving Data
      • Added input format and validation pattern
    • 0.1.1 (13 Jan 2022)

      • Added SGTraDex helper API, JWKS API
    • 0.1.0 (12 August 2021)

      • Initial Draft including APIs for pull and push data

    Releases and Compatibility

    Releases

    SGDex's RESTful API adopts Semantic Versioning 2.0.0 for releases with the following format:

    {MAJOR}.{MINOR}.{PATCH}

    The table below lists the possible changes to the release version numbers and what they imply.

    {MAJOR} increments {MINOR} increments {PATCH} increments
    Introduces incompatible API changes with the previous {MAJOR} version Introduces new functionalities or information that are backward compatible Introduces bug fixes and remains backward compatible
    e.g. v1.2.1 --> v2.0.0 e.g. v1.2.1 --> v1.3.0 e.g. v1.2.1 --> v1.2.2

    Despite backward compatibility provided in {MINOR} and {PATCH} releases, developers should still ensure that their existing implementations are not disrupted as a result of these new releases.

    Pre-releases/Drafts

    Pre-release or draft versions, when provided, are denoted by an appended hypen- with a series of separate identifiers {LABEL}-{VERSION} following the{PATCH} number.

    {MAJOR}.{MINOR}.{PATCH}-{LABEl}-{VERSION}

    Such releases are unstable and may not provide the intended compatibility with the specification in draft status.

    SUPPORT

    Please contact the SGDex team at support@sgdex.gov.sg for support.

    Retrieving JSON Web Key Set (JWKS)

    Get Public Key

    This API will return the updated SGDex's public key information by default. With passing kid (the unique identifier for the key) in the path parameter, this API will return the specified public key information.

    path Parameters
    kid
    string

    The unique identifier for the key.

    NOTE: If this parameter is not provided, the result will show an array of keys that are available.

    Responses

    Response samples

    Content type
    application/json
    Example
    {
    • "keys": [
      ]
    }

    Usecase

    Create Usecase

    This API allows admin to create a Usecase.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    usecase_id
    required
    string

    Unique ID of the Usecase you want to create. The usecase_id is a case-sensitive alphanumeric string that does not allow for spaces or special characters with the exception of '-' and '_'.

    name
    required
    string

    The name of the Usecase you want to create.

    description
    required
    string

    The description of the Usecase you want to create

    Responses

    Request samples

    Content type
    application/json
    {
    • "usecase_id": "sample_usecase_id",
    • "name": "Sample Usecase",
    • "description": "This is a sample Usecase."
    }

    Response samples

    Content type
    application/json
    {
    • "usecase_id": "sample_usecase_id"
    }

    Get Usecase

    This API allows admin to get a Usecase or get a list of Usecases.

    • If usecase_id is specified, then this API will return a list with a single Usecase.
    • If usecase_id is not specified, then this API will return a list of all Usecases in the Dex.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_id
    string

    The unique id of the Usecase you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Usecase

    This API allows admin to update a Usecase.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_id
    required
    string

    The unique id of the Usecase you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    usecase_name
    required
    string

    The name of the Usecase.

    description
    required
    string

    The description of the Usecase.

    Responses

    Request samples

    Content type
    application/json
    {
    • "usecase_name": "Sample Usecase 2",
    • "description": "This is a sample Usecase."
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Usecase

    This API allows admin to delete a Usecase.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_id
    required
    string

    The unique id of the Usecase you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Usecase API

    Create Usecase API

    This API allows admin to create a Usecase API.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    name
    required
    string

    The name of the Usecase API you want to create.

    description
    required
    string

    The description of the Usecase API you want to create.

    version
    required
    integer

    The version number of the Usecase API you want to create. It has to be a positive integer.

    http_method
    required
    string

    The HTTP method that this Usecase API will use.

    api_type
    required
    string

    The type of this Usecase API. Value can only be SYNC or ASYNC

    object

    This object only needs to be defined for oauth2 Usecase APIs

    softlink
    Array of strings

    An array of strings that specify the Usecases that this Usecase API is related to.

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "sample_api",
    • "version": 1,
    • "http_method": "GET",
    • "description": "This is a sample Usecase API.",
    • "api_type": "SYNC",
    • "oauth2": {
      },
    • "softlink": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "usecase_api_id": "f727a5a9-5d30-49f8-8dd7-5b315cab5f4b"
    }

    Get Usecase API

    This API allows admin to get a Usecase API or get a list of Usecase APIs that satisfy the attributes you specify.

    • If usecase_api_id is specified, then this API will return a list with a single Usecase API.
    • If usecase_api_id is not specified and other criteria are specified, then this API will return a list of all Usecase APIs that satisfy those criteria.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_api_id
    string

    The unique id of the Usecase API you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    name
    string
    Example: name=sample_name

    The name of the Usecase API you are interested in. If this is specified, usecase_api_id must not be specified. This field must be specified if usecase_api_id is not specified.

    http_method
    string
    Example: http_method=GET

    The HTTP method of the Usecase API you are interested in. This is an optional field when the name is specified.

    version
    integer
    Example: version=1

    The version of the Usecase API you are interested in. This is an optional field when the name is specified.

    published
    boolean
    Example: published=true

    The published status of the Usecase API you are interested in. This is an optional field when the name is specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Usecase API

    This API allows admin to update a Usecase API.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_api_id
    required
    string

    The unique id of the Usecase API you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    name
    required
    string

    The name of the Usecase API.

    description
    required
    string

    The description of the Usecase API.

    version
    required
    integer

    The version number of the Usecase API. It has to be a positive integer.

    http_method
    required
    string

    The HTTP method that this Usecase API will use.

    api_type
    required
    string

    The type of this Usecase API. Value can only be SYNC or ASYNC

    object

    This object only needs to be defined for oauth2 Usecase APIs

    softlink
    Array of strings

    An array of strings that specify the Usecases that this Usecase API is related to.

    published
    boolean

    Set this to true when you want to publish this Usecase API. You cannot unpublish a Usecase API once it is published.

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "sample_api_changed",
    • "version": 1,
    • "http_method": "POST",
    • "description": "This is a changed sample Usecase API.",
    • "api_type": "SYNC",
    • "oauth2": {
      },
    • "softlink": [
      ],
    • "published": true
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Usecase API

    This API allows admin to delete a Usecase API.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_api_id
    required
    string

    The unique id of the Usecase API you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Usecase Topic

    Create Usecase Topic

    This API allows admin to create a Usecase Topic.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    name
    required
    string

    The name of the Usecase Topic you want to create.

    description
    required
    string

    The description of the Usecase Topic you want to create.

    softlink
    Array of strings

    An array of strings that specify the Usecases that this Usecase Topic is related to.

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "sample_topic",
    • "description": "This is a sample Usecase Topic.",
    • "softlink": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "usecase_topic_id": "14fb72b6-325d-4174-9aaf-fafeef7ddd9e"
    }

    Get Usecase Topic

    This API allows admin to get a Usecase Topic or get a list of Usecase Topics with certain attributes you specify.

    • If usecase_topic_id is specified, then this API will only return a list with a single Usecase Topic.
    • If usecase_topic_id is not specified and name is specified, then this API will return a list of all Usecase Topics with that name.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_topic_id
    string

    The unique id of the Usecase Topic you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    name
    string
    Example: name=sample_topic

    The name of the Usecase Topic you are interested in. If this is specified, usecase_topic_id must not be specified. This field must be specified if usecase_topic_id is not specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Usecase Topic

    This API allows admin to update a Usecase Topic.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_topic_id
    required
    string

    The unique id of the Usecase Topic you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    name
    required
    string

    The name of the Usecase Topic.

    description
    required
    string

    The description of the Usecase Topic.

    softlink
    Array of strings

    An array of strings that specify the Usecases that this Usecase Topic is related to.

    published
    boolean

    Set this to true when you want to publish this Usecase Topic. You cannot unpublish a Usecase Topic once it is published.

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "sample_topic_changed",
    • "description": "This is a changed sample Usecase Topic.",
    • "softlink": [
      ],
    • "published": true
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Usecase Topic

    This API allows admin to delete a Usecase Topic.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    usecase_topic_id
    required
    string

    The unique id of the Usecase Topic you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Participant

    Create Participant

    This API allows admin to create a Participant.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    entity_id
    required
    string

    The UEN that this participant would be part of.

    alias
    required
    string

    The alias of the participant.

    description
    required
    string

    The description of the participant.

    Responses

    Request samples

    Content type
    application/json
    {
    • "entity_id": "197900305Z",
    • "alias": "participant1",
    • "description": "This is a sample participant."
    }

    Response samples

    Content type
    application/json
    {
    • "participant_id": "28c60ead-9584-4998-a94d-2fae8ed61615"
    }

    Get Participant

    This API allows admin to get a Participant, get a list of Participants based on organisation_id or get all Participants in the Dex.

    • If participant_id is specified, then this API will only return a list wih a single Participant.
    • If participant_id is not specified and entity_id is specified, then this API will return a list of all Participants in the Dex part of this entity_id.
    • If both participant_id and entity_id are not specified, then this API will return a list of Participants in the Dex.
    path Parameters
    participant_id
    string

    The unique id of the Participant you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    entity_id
    string
    Example: entity_id=197900305Z

    The entity_id you are interested in. If this is specified, participant_id should not be specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Participant

    This API allows admin to update a Participant.

    path Parameters
    participant_id
    required
    string

    The unique id of the Participant you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    description
    required
    string

    The new description of the Participant.

    Responses

    Request samples

    Content type
    application/json
    {
    • "description": "This is the new sample description."
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Participant

    This API allows admin to delete a Participant.

    path Parameters
    participant_id
    required
    string

    The unique id of the Participant you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    JWKS Endpoint

    Create JWKS Endpoint

    This API allows admin to create a JWKS Endpoint.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    participant_id
    required
    string

    The unique ID of the participant that this JWKS endpoint belongs to.

    url
    required
    string

    The url of this JWKS Endpoint.

    Responses

    Request samples

    Content type
    application/json
    {}

    Response samples

    Content type
    application/json
    {
    • "jwks_endpoint_id": "5349afea-934d-47f1-9ff4-b55a33ef453b"
    }

    Get JWKS Endpoint

    This API allows admin to get a JWKS Endpoint or get a list of JWKS Endpoints based on participant_id.

    • If jwks_endpoint_id is specified, then this API will return a list with a single JWKS Endpoint.
    • If jwks_endpoint_id is not specified and participant_id is specified, then this API will return a list of all JWKS Endpoints belonging to this Participant.
    path Parameters
    jwks_endpoint_id
    string

    The unique id of the JWKS Endpoint you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    participant_id
    string
    Example: participant_id=28c60ead-9584-4998-a94d-2fae8ed61615

    The participant_id of the Participant you are interested in. If this is specified, jwks_endpoint_id should not be specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update JWKS Endpoint

    This API allows admin to update a JWKS Endpoint.

    path Parameters
    jwks_endpoint_id
    required
    string

    The unique id of the JWKS Endpoint you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    url
    required
    string

    The new url of this JWKS Endpoint.

    Responses

    Request samples

    Content type
    application/json
    {}

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete JWKS Endpoint

    This API allows admin to delete a JWKS Endpoint.

    path Parameters
    jwks_endpoint_id
    required
    string

    The unique id of the JWKS Endpoint you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Application

    Create Application

    This API allows admin to create an Application.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    application_id
    string

    The unique ID of this application. If not specified, your application will be assigned an application_id.

    name
    required
    string

    The name of the application.

    description
    required
    string

    The description of the application.

    participant_id
    required
    string

    The participant_id of the Participant this application belongs to.

    required
    object

    The security mechanism information of this application.

    webhook_id
    string

    The webhook_id of the Webhook that this application uses.

    Responses

    Request samples

    Content type
    application/json
    {
    • "application_id": "myApp_id",
    • "name": "myApp",
    • "participant_id": "28c60ead-9584-4998-a94d-2fae8ed61615",
    • "description": "This is a sample application.",
    • "security_mechanism": {
      },
    • "webhook_id": "d4e677a6-2866-4f93-bcbe-735814c38398"
    }

    Response samples

    Content type
    application/json
    {
    • "application_id": "myApp_id"
    }

    Get Application

    This API allows admin to get an Application or get a list of Applications based on participant_id.

    • If application_id is specified, then this API will return a list with a single Application.
    • If application_id is not specified and participant_id is specified, then this API will return a list of all Application belonging to this Participant.
    path Parameters
    application_id
    string

    The unique id of the Application you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    participant_id
    string
    Example: participant_id=28c60ead-9584-4998-a94d-2fae8ed61615

    The participant_id of the Participant you are interested in. If this is specified, application_id should not be specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Application

    This API allows admin to update an Application.

    path Parameters
    application_id
    required
    string

    The unique id of the application you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    participant_id
    required
    string

    The unique id of the participant that this application belongs to.

    name
    required
    string

    The name of this application.

    description
    required
    string

    The description of this application.

    required
    object

    The security mechanism of this application.

    webhook_id
    string

    The webhook_id of the Webhook that this application uses.

    Responses

    Request samples

    Content type
    application/json
    {
    • "participant_id": "28c60ead-9584-4998-a94d-2fae8ed61615",
    • "name": "myAppNew",
    • "description": "This is a new sample application description.",
    • "security_mechanism": {
      },
    • "webhook_id": "d4e677a6-2866-4f93-bcbe-735814c38398"
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Application

    This API allows admin to delete an Application.

    path Parameters
    application_id
    required
    string

    The unique id of the Application you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Endpoint

    Create Endpoint

    This API allows admin to create an Endpoint.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    participant_id
    required
    string

    The participant ID assigned to you.

    name
    required
    string

    The name of the endpoint you want to create.

    description
    required
    string

    The description of the endpoint you want to create.

    url
    required
    string

    The url of the endpoint you want to create.

    http_method
    required
    string

    The http method of the endpoint you want to create.

    required
    object

    The security mechanism details of the endpoint you want to create.

    timeout
    number

    The timeout value of the endpoint you want to create.

    Responses

    Request samples

    Content type
    application/json
    {
    • "participant_id": "STG-20230201M-TEST",
    • "name": "Sample endpoint",
    • "description": "This is a sample endpoint",
    • "http_method": "POST",
    • "security_mechanism": {
      },
    • "timeout": 8000
    }

    Response samples

    Content type
    application/json
    {
    • "endpoint_id": "3d8a3fe5-cbaa-4b70-8a6c-a70362ccb6e5"
    }

    Get Endpoint

    This API allows admin to get an Endpoint or get a list of Endpoints with certain attributes you specify.

    • If endpoint_id is specified, then this API will return a list with a single Endpoint.
    • If endpoint_id is not specified and other criteria are specified, then this API will return a list of all Endpoints that satisfy those criteria in the Dex.
    path Parameters
    endpoint_id
    required
    string

    The unique id of the Endpoint you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    participant_id
    required
    string
    Example: participant_id=STG-231696441I-PARTICIPANT

    The participant id of the Endpoint you are interested in. This field must be specified if webhook_id is not specified.

    name
    string
    Example: name=sample_name

    The name of the Endpoint you are interested in.

    http_method
    string
    Example: http_method=POST

    The http_method of the Endpoint you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Endpoint

    This API allows admin to update an Endpoint.

    path Parameters
    endpoint_id
    required
    string

    The unique id of the Endpoint you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    name
    required
    string

    The name of the endpoint you want to update.

    description
    required
    string

    The description of the endpoint you want to update.

    url
    required
    string

    The url of the endpoint you want to update.

    http_method
    required
    string

    The http method of the endpoint you want to update.

    required
    object

    The security mechanism details of the endpoint you want to create.

    timeout
    number

    The timeout value of the endpoint you want to update.

    Responses

    Request samples

    Content type
    application/json
    {
    • "name": "Sample updated endpoint",
    • "description": "This is a sample update endpoint request",
    • "http_method": "POST",
    • "security_mechanism": {
      },
    • "timeout": 5000
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Endpoint

    This API allows admin to delete an Endpoint.

    path Parameters
    endpoint_id
    required
    string

    The unique id of the Endpoint you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Webhook

    Create Webhook

    This API allows admin to create a Webhook.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    participant_id
    required
    string

    The participant ID assigned to you.

    description
    required
    string

    The description of the webhook you want to create.

    url
    required
    string

    The url of the webhook you want to create.

    required
    object

    The security mechanism details of the webhook you want to create.

    timeout
    number

    The timeout value of the webhook you want to create.

    Responses

    Request samples

    Content type
    application/json
    {
    • "participant_id": "STG-20230201M-TEST",
    • "description": "This is a sample webhook",
    • "security_mechanism": {
      },
    • "timeout": 8000
    }

    Response samples

    Content type
    application/json
    {
    • "webhook_id": "3d8a3fe5-cbaa-4b70-8a6c-a70362ccb6e5"
    }

    Get Webhook

    This API allows admin to get a Webhook or get a list of Webhooks with certain attributes you specify.

    • If webhook_id is specified, then this API will return a list with a single Webhook.
    • If webhook_id is not specified and other criteria are specified, then this API will return a list of all Webhooks that satisfy those criteria in the Dex.
    path Parameters
    webhook_id
    string

    The unique id of the Webhook you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    participant_id
    string
    Example: participant_id=STG-231696441I-PARTICIPANT

    The participant id of the Webhook you are interested in. This field must be specified if webhook_id is not specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Webhook

    This API allows admin to update a Webhook.

    path Parameters
    webhook_id
    required
    string

    The unique id of the Webhook you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    description
    required
    string

    The description of the webhook you want to update.

    url
    required
    string

    The url of the webhook you want to update.

    required
    object

    The security mechanism details of the webhook you want to update.

    timeout
    number

    The timeout value of the webhook you want to update.

    Responses

    Request samples

    Content type
    application/json
    {
    • "description": "This is a sample update webhook request",
    • "security_mechanism": {
      },
    • "timeout": 5000
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Webhook

    This API allows admin to delete a Webhook.

    path Parameters
    webhook_id
    required
    string

    The unique id of the Webhook you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Enrolment

    Create Enrolment

    This API allows admin to create an Enrolment.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    provider_id
    required
    string

    The participant ID assigned to you.

    enrolment_type
    required
    string

    The type of the enrolment you want to create. Value can only be api, asyncapi or topic

    description
    required
    string

    The description of the enrolment you want to create.

    usecase_api_id
    string

    The usecase api you want to enrol. **applicable when enrolment_type is api or asyncapi

    scope
    string

    The scope you want to enrol. **applicable when enrolment_type is api

    endpoint_id
    string

    The endpoint you want to use in this enrolment. **applicable when enrolment_type is api or asyncapi

    usecase_topic_id
    string

    The usecase topic you want to enrol. **applicable when enrolment_type is topic

    system_id
    string

    The system you want to use in this enrolment. **applicable when enrolment_type is topic

    status
    string

    The status of the enrolment you want to create.

    required
    Array of objects

    An array of object that contains the list of tasks required for this endpoint. The details required for each task vary depending on the configuration.

    Responses

    Request samples

    Content type
    application/json
    {
    • "provider_id": "STG-20230201M-TEST",
    • "enrolment_type": "api",
    • "description": "This is a sample enrolment",
    • "usecase_api_id": "19628b69-3fa4-4963-b387-48efff088753",
    • "endpoint_id": "238f92b4-6386-4e10-a391-08842b460797",
    • "processing_task": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "enrolment_id": "b0c97cc9-d458-4f14-b2c8-b348ba06f35a"
    }

    Get Enrolment

    This API allows admin to get an Enrolment or get a list of Enrolments with certain attributes you specify.

    • If enrolment_id is specified, then this API will return a list with a single Enrolment.
    • If enrolment_id is not specified and other criteria are specified, then this API will return a list of all Enrolments that satisfy those criteria in the Dex.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    enrolment_id
    string

    The unique id of the enrolment you are interested in.

    query Parameters
    provider_id
    string
    Example: provider_id=STG-231696441I-PROVIDER

    The participant id of the Webhook you are interested in. This field must be specified if enrolment_id is not specified.

    status
    string
    Example: status=APPROVED

    enrolment status. Value can be APPROVED, REJECTED, PENDING, WITHDRAWN_BY_CONSUMER, WITHDRAWN_BY_PROVIDER, WITHDRAWN_BY_ADMIN

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Enrolment

    This API allows admin to approve or reject an Enrolment.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    enrolment_id
    required
    string

    The unique id of the Enrolment you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    status
    required
    string

    The status you want to update for your enrolment. Current supported values are APPROVED or REJECTED

    comment
    string

    The comment you want to update for your enrolment. **mandatory when status is REJECTED

    Array of objects

    An array of object that contains the list of tasks required for this endpoint. The details required for each task vary depending on the configuration. **applicable only when status is APPROVED

    Responses

    Request samples

    Content type
    application/json
    {
    • "status": "APPROVED",
    • "comment": "I approved this enrolment",
    • "processing_task": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Enrolment

    This API allows admin to delete an Enrolment.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    enrolment_id
    required
    string

    The unique id of the Enrolment you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Subscription

    Create Subscription

    This API allows admin to create a Subscription.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    consumer_id
    required
    string

    The participant ID assigned to you.

    description
    required
    string

    The description of the subscription you want to create.

    Array of objects

    The list of usecase api you want to subscribe. **either api or topic must be presented

    Array of objects

    The list of usecase topic you want to subscribe. **either api or topic must be presented

    Responses

    Request samples

    Content type
    application/json
    {
    • "consumer_id": "STG-20230201M-TEST",
    • "description": "My subscription",
    • "api": [
      ],
    • "topic": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "subscription_id": [
      ]
    }

    Get Subscription

    This API allows admin to get a Subscription or get a list of Subscriptions with certain attributes you specify.

    • If subscription_id is specified, then this API will return a list with a single Subscription.
    • If subscription_id is not specified and other criteria are specified, then this API will return a list of all Subscriptions that satisfy those criteria in the Dex.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_id
    string

    The unique id of the subscription you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    consumer_id
    string
    Example: consumer_id=STG-231696441I-CONSUMER

    The participant id of the Webhook you are interested in. This field must be specified if subscription_id is not specified.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Update Subscription

    This API allows admin to update the scope of Subscription.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_id
    required
    string

    The unique id of the Subscription you want to update.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    scope
    required
    Array of arrays

    The new scope array to update in subscription.

    Responses

    Request samples

    Content type
    application/json
    {
    • "scope": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Delete Subscription

    This API allows admin to delete Subscription/Subscription(s).

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_id
    string

    The unique id of the Subscription you are interested in.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    subscriptions
    Array of arrays

    The list of subscriptions ids to delete.

    Responses

    Request samples

    Content type
    application/json
    {
    • "subscription": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Approve/Reject Subscription

    This API allows admin to approve or reject Subscription.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_id
    required
    string

    The unique id of the Subscription you want to approve/reject.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    status
    required
    string

    The given status for the subscription.

    comment
    string

    The comment of approving/rejecting the subscription. **mandatory when rejecting the subscription

    Responses

    Request samples

    Content type
    application/json
    {
    • "status": "REJECTED",
    • "comment": "Rejected subscription due to invalid scope requested"
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Create Authorisation Request

    This API allows data provider to grant permission to data consumer.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    request_type
    required
    string

    The type of this authorisation request.

    consumer_id
    required
    string

    The consumer you want to give permission to consume your data.

    client_id
    required
    string

    The consumer application you want to give permission to consume your data.

    provider_id
    required
    string

    The participant ID assigned to you.

    endpoint_id
    required
    string

    The endpoint you want to give permission to consumer.

    usecase_api_id
    required
    string

    The usecase api that your endpoint is enrolled.

    status
    string

    The status of the authorisation request you want to create.

    description
    string

    The description of the authorisation request you want to create.

    Responses

    Request samples

    Content type
    application/json
    {
    • "request_type": "api",
    • "consumer_id": "STG-20230201M-TEST",
    • "client_id": "STG-20230201M-TEST-APP",
    • "provider_id": "STG-20240516H-PROVIDER",
    • "endpoint_id": "8310efad-c183-46c6-85f4-874019997e64",
    • "usecase_api_id": "d34c1cf4-616e-460c-96d3-cfea06dd4fe2",
    • "status": "APPROVED",
    • "description": "My Authorisation Request"
    }

    Response samples

    Content type
    application/json
    {
    • "api_subscription_request_id": "9f654e70-24fb-4885-be6c-417760c4fcfa"
    }

    Get Subscription Request

    This API allows admin to get a Subscription Request or get a list of Subscription Request with certain attributes you specify.

    • If subscription_request_id is specified, then this API will return a list with a single Subscription Request.
    • If subscription_request_id is not specified and other criteria are specified, then this API will return a list of all Subscription Request that satisfy those criteria in the Dex.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_request_id
    string

    The unique id of the subscription request you are interested in. If this is specified, no query string parameters should be specified.

    query Parameters
    provider_id
    string
    Example: provider_id=STG-241696441L-PROVIDER

    The participant id of the subscription request you are interested in. This field must be specified if subscription_request_id is not specified.

    status
    string
    Example: status=APPROVED

    status of subscription request you are interested in. Value can be APPROVED, REJECTED, PENDING, WITHDRAWN_BY_CONSUMER, WITHDRAWN_BY_PROVIDER, WITHDRAWN_BY_ADMIN

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Approve/Reject Subscription Request

    This API allows admin to approve or reject Subscription Request.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    subscription_request_id
    required
    string

    The unique id of the Subscription Request you want to approve/reject.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    status
    required
    string

    The given status for the subscription request.

    comment
    string

    The comment of approving/rejecting the subscription request. **mandatory when rejecting the subscription request

    Responses

    Request samples

    Content type
    application/json
    {
    • "status": "REJECTED",
    • "comment": "Rejected subscription request"
    }

    Response samples

    Content type
    application/json
    {
    • "code": 0,
    • "message": "string"
    }

    Retrieving Data

    Get Data (SYNC)

    This API will federate the call to fetch from relevant providers based on pre-existing configuration and return the combined responses.
    This is a synchronous GET call to pull the data. Data will be in the response payload.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    apiname
    required
    string

    A unique api name within the specific data exchange.

    query Parameters
    client_id
    required
    string

    Unique ID for the data consuming service.

    provider
    Array of strings

    The id of providers to get the data from.

    query
    string
    Example: query=filter:my filter parameter

    An optional query parameter to filter the result based. This parameter will be passed to the provider end and can be intercepted by the data exchange layer to perform a filtered query to the provider API.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Get Data (SYNC)

    This API will federate the call to fetch from relevant providers based on pre-existing configuration and return the combined responses.
    This is a synchronous POST call to pull the data. Data will be in the response payload.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    apiname
    required
    string

    A unique api name within the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token. Refer to Data Exchange (Client) Authentication section on how this token should be generated.

    Request Body schema: application/json
    client_id
    required
    string

    Unique ID for the data consuming service.

    provider
    Array of strings

    The id of providers to get the data from.

    query
    string

    An optional query parameter to filter the result based. This parameter will be passed to the provider end and can be intercepted by the data exchange layer to perform a filtered query to the provider API.

    payload
    string

    An optional stringtify payload parameter. This payload will be passed to the provider end.

    Note - If both payload and query are given, query will be ignored.

    Responses

    Request samples

    Content type
    application/json
    {
    • "client_id": "client123",
    • "provider": [
      ],
    • "query": "filter=myfilter",
    • "payload": "{attribute1: xx, attribute2: xx}"
    }

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Get Data via Resource ID Deprecated

    This API will federate the call to fetch from relevant providers based on authorisation and return the responses in an array.
    This is a synchronous GET call to federate the data request, the response will be the received payload packed in an array.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    apiname
    required
    string

    A unique api name within the specific data exchange.

    identifier
    required
    string

    A unique identifier of a user. You can get this identifier from the access token (JWT) sub parameter after calling Token endpoint.

    query Parameters
    client_id
    required
    string

    Unique ID for the data consuming service.

    scope
    required
    Array of string
    Example: scope=scopeA scopeB scopeC

    Space separated list of scope requested.

    header Parameters
    DPoP
    required
    string

    Example: Refer to Demonstration of Proof of Possesion (DPoP)

    Include the generated Demonstration of Proof of Possession token.

    Authorization
    required
    string

    Include the access token (JWT) from /token API in this header prefixed with 'DPoP'.

    Responses

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Get Data via Resource ID

    This API returns user's data from data source(s) when presented with a valid access token obtained from the Token API.

    Prerequisite: Client application is required to call Authorise API to get user consent and Token API to get the access token before calling the Data API.

    path Parameters
    identifier
    required
    string

    A unique identifier of a user. You can get this identifier from the access token (JWT) sub parameter after calling token endpoint.

    header Parameters
    Authorization
    required
    string

    Access token JWT that was returned from token call

    Request Body schema: application/json
    client_assertion
    required
    string

    The assertion being used to authenticate the client, please refer to Client Assertion for details. This JWT is signed with consumer private key and contains the following parameters:

    • sub: Subject - client_id issued by SGDex upon onboarding
    • jti: JWT ID - random unique number
    • aud: Audience - URL that partner application is calling
    • iss: Issuer - client_id issued by SGDex upon onboarding
    • iat: Issued At - current timestamp, maximum 300 seconds ago (5 minutes)
    • exp: Expiry - expiry timestamp, maximum 300 seconds (5 minutes)
    • htm: HTTP method
    client_assertion_type
    required
    string

    The format of the assertion as defined by the authorization server. The value will be an absolute URI. Example: urn:ietf:params:oauth:client-assertion-type:jwt-bearer

    encryptionKid
    string

    Consuming applications can specify Key ID in their registered JWKS to encrypt response payload with.

    Responses

    Request samples

    Content type
    application/json
    {
    • "client_assertion": "string",
    • "client_assertion_type": "string",
    • "encryptionKid": "string"
    }

    Response samples

    Content type
    application/json
    [
    • {
      }
    ]

    Request for Data (ASYNC)

    This API will federate the call to request data from relevant providers based on pre-existing configuration. Once the request is received on the provider side, provider will initiate a PUSH call if the request is valid.
    This is an asynchronous request for data. Response will only be ACK.

    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    apiname
    required
    string

    A unique api name within the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    client_id
    required
    string

    Unique ID for the data consuming service.

    provider
    Array of strings

    The id of providers to get the data from.

    query
    string

    An optional query parameter to filter the result based. This parameter will be passed to the provider end and can be intercepted by the data exchange layer to perform a filtered query to the provider API.

    payload
    string

    An optional stringtify payload parameter. This payload will be passed to the provider end.

    Note - If both payload and query are given, query will be ignored.

    Responses

    Request samples

    Content type
    application/json
    {
    • "client_id": "client123",
    • "provider": [
      ],
    • "query": "filter=myfilter",
    • "payload": "{attribute1: xx, attribute2: xx}"
    }

    Response samples

    Content type
    application/json
    {
    • "message": "Accepted"
    }

    Providing Data

    Push Data

    This API allows provider to push data to a use case topic.

    • If target consumer (list of consumers) is specified, then data will be sent to the specified consumers who are subscribers of the topic.
    • If target consumer (list of consumers) is not specified, then data will be broadcast to all subscribers of that use case topic.
    path Parameters
    dex
    required
    string

    A unique name tag for the specific data exchange.

    topicname
    required
    string

    A unique api name within the specific data exchange.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    consumer
    Array of strings

    The id of consumers to push the data to.

    system_id
    required
    string

    Unique ID of the provider system.

    payload
    required
    string

    The data payload to push to the topic

    Responses

    Request samples

    Content type
    application/json
    {
    • "consumer": [
      ],
    • "system_id": "my system id",
    • "payload": "<encrypted/encoded payload>"
    }

    Response samples

    Content type
    application/json
    {
    • "request_id": "string"
    }

    Routing and Notification

    Routing

    This API will federate the call to pull/push data from/to relevant pitstops

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    type
    required
    string
    Enum: "PROVIDE" "RECEIVE" "PULL_RESULT" "PUSH_RESULT" "TEST_PUSH" "TEST_PULL"

    Specifies the type of message e.g. PUSH, PULL, PROVIDE,

    dataElementId
    required
    string

    The data element ID for this transaction

    requestId
    required
    string

    UUID of the request ID

    required
    object (systemDetail)
    required
    Array of objects (systemDetail)
    required
    Array of objects (orgDetail)
    payload
    string

    Encrypted payload. Only required for type = RECEIVE | PULL_RESULT

    parameters
    object

    The pull parameters. Only required for type = PROVIDE

    Responses

    Request samples

    Content type
    application/json
    {
    • "type": "RECEIVE",
    • "dataElementId": "bill_of_lading",
    • "sender": {
      },
    • "recipients": [
      ],
    • "requestId": "1234567890",
    • "payload": "<HASHED>",
    • "parameters": {
      },
    • "onBehalfOf": [
      ]
    }

    Response samples

    Content type
    application/json
    {
    • "message": "Request received"
    }

    Notification

    This API allows SGTraDex to notify SGDex of pitstops configuration changes.

    header Parameters
    Authorization
    required
    string

    Example: Refer to Data Exchange (Client) Authentication
    JWT provided in the Authorization header as a bearer token.

    Request Body schema: application/json
    recipients
    required
    Array of strings

    List of System IDs of the recipients to send to

    type
    required
    string
    Value: "CONFIG_REFRESH"
    senderId
    required
    string

    Unique identifier of sender's system

    Responses

    Request samples

    Content type
    application/json
    {
    • "recipients": [
      ],
    • "type": "CONFIG_REFRESH"
    }

    Response samples

    Content type
    application/json
    {
    • "message": "Notification Sent"
    }

    Configuration

    Data Element

    Create Data Elements

    Request Body schema: application/json
    Array
    dataElementId
    required
    string^[a-zA-Z0-9-_]+$
    elementName
    string^[a-zA-Z0-9-_.,& ]+$

    Name of the data element. This field will be ignored by SGDex

    elementSchema
    string

    Schema of the data element (in JSON Schema Format). This field will be ignored by SGDex

    querySchema
    string

    Schema of how to query the data element (Also in JSON Schema format). This field will be ignored by SGDex

    csvTemplate
    string

    Template in csv. This field will be ignored by SGDex

    jsonTemplate
    string

    Template in JSON. This field will be ignored by SGDex

    type
    string
    Enum: "DOCUMENT" "EVENT"

    Indicates whether it is a document or event. This field will be ignored by SGDex

    additionalProperties
    object

    Any other addtional properties. This field will be ignored by SGDex

    Responses

    Request samples

    Content type
    application/json
    [
    • {
      }
    ]

    Data Element

    Delete a Data Element

    path Parameters
    dataElementId
    required
    string^[a-zA-Z0-9-_]+$

    Responses

    System

    Create new Systems

    Request Body schema: application/json
    Array
    systemId
    required
    string <uuid>

    The ID of the system

    systemName
    required
    string^[a-zA-Z0-9-_.,&()@:;?!'"‘’“”{}<>\\\/\[\] ]+$...

    The name of the system

    endPointUrl
    required
    string <uri>

    The full URL of the pitstop to send data exchange events to e.g. https://trafigura.test.sgtradex.io/api/v1/data/messageHandler

    orgId
    string <uuid>

    The Organization Id that this system belongs to. This field will be ignored by SGDex

    additionalProperties
    object

    Any other addtional properties. This field will be ignored by SGDex

    Responses

    Request samples

    Content type
    application/json
    [
    • {
      }
    ]

    System

    Update a System detail

    path Parameters
    systemId
    required
    string <uuid>

    The ID of the system to update

    Request Body schema: application/json
    systemName
    required
    string^[a-zA-Z0-9-_.,&()@:;?!'"‘’“”{}<>\\\/\[\] ]+$...

    The name of the system

    endPointUrl
    required
    string <uri>

    The full URL of the pitstop to send data exchange events to e.g. https://trafigura.test.sgtradex.io/api/v1/data/messageHandler

    orgId
    string <uuid>

    The Organization Id that this system belongs to. This field will be ignored by SGDex

    additionalProperties
    object

    Any other addtional properties. This field will be ignored by SGDex

    Responses

    Request samples

    Content type
    application/json
    {
    • "systemName": "string",
    • "endPointUrl": "http://example.com",
    • "orgId": "25b2c2d5-a7fc-47d0-89e4-8709a1560bfa",
    • "additionalProperties": { }
    }

    System

    Deletes new Systems

    path Parameters
    systemId
    required
    string <uuid>

    The ID of the sytem to delete

    Responses

    Subscription

    Create a new subscription between parties

    Request Body schema: application/json
    Array
    subscriptionId
    required
    string <uuid>

    The ID of the subscription created

    subscriberOrgId
    string <uuid>

    The ID of the organization consuming the data element. This field will be ignored by SGDex

    subscriberSystemId
    required
    string <uuid>

    The ID of the system the consuming organization is using to consume the data element

    subscriberEnrolmentId
    string <uuid>

    The Enrolment ID for the consumer. This field will be ignored by SGDex

    prosumerOrgId
    string <uuid>

    The ID of the organization producing the data element. This field will be ignored by SGDex

    prosumerSystemId
    required
    string <uuid>

    The ID of the system the producing organization is using to produce the data element

    providerEnrolmentId
    string <uuid>

    The Enrolment ID for the producer. This field will be ignored by SGDex

    useCaseId
    required
    string^[a-zA-Z0-9-_]+$

    The ID of the Use Case related to this subscription

    dataElementId
    required
    string^[a-zA-Z0-9-_]+$

    The Data Element Id related to this subscription

    prosumerType
    string

    This field will be ignored by SGDex

    status
    required
    string
    Enum: "APPROVED" "PENDING" "REVOKED" "REJECTED"
    requesterOrgId
    string <uuid>

    This field will be ignored by SGDex

    contributorOrgId
    string <uuid>

    The ID of the organization owning the data

    contributorSystemId
    string <uuid>

    The ID of the system the data contributor is using

    Responses

    Request samples

    Content type
    application/json
    [
    • {
      }
    ]

    Subscription

    Deletes a subscription between parties (either because rejected or revoked)

    path Parameters
    subscriptionId
    required
    string <uuid>

    Responses