Skip to main content

Provider

The Provider API allows you to create, manage, and delete custom data providers that can be used within your projects to generate specific data.

Authentication​

Include the API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Endpoints​

Creating Providers​

POST /provider

This endpoint creates one or more custom data providers. You can define the provider's name and the list of data it will generate.

Parameters:​

  • name (required): The name of the provider.
  • data (required): A list of values that define the data the provider will generate.
Example Request Body:​
[
{
"name": "CustomUserData",
"data": ["user1", "user2", "user3"]
},
{
"name": "CustomOrderData",
"data": ["order1", "order2", "order3"]
}
]

Response:​

[
{
"id": "provider123",
"name": "CustomUserData"
},
{
"id": "provider124",
"name": "CustomOrderData"
}
]

This request creates two new data providers: CustomUserData and CustomOrderData.

Retrieving a Provider​

GET /provider/:id

This endpoint retrieves the details of a specific data provider by its ID.

Parameters:​

  • :id (required): The ID of the provider to retrieve.

Example Request:​

GET /provider/provider123

Response:​

{
"id": "provider123",
"name": "CustomUserData",
"data": ["user1", "user2", "user3"]
}

The response includes the provider's ID, name, and the data it generates.

Updating a Provider​

PUT /provider/:id

This endpoint updates an existing provider.

Parameters:​

  • data (required): The updated list of values the provider will generate.

Example Request Body:​

{
"data": ["user4", "user5"]
}

Response:​

{
"id": "provider123",
"name": "UpdatedUserData"
}

Deleting a Provider​

DELETE /provider/:id

This endpoint deletes a specific data provider by its ID.

Parameters:​
  • :id (required): The ID of the provider to delete.

The response will confirm the successful deletion of the provider.

Example Request:​

DELETE /provider/provider123

Response:​

{
"message": "Provider provider123 deleted successfully."
}