Dynamic Stores

Endpoints for managing dynamic data stores

Get Dynamic Data Store

get
/dynamicStore/{dynamicStoreId}

Gets a dynamic data store by specific ID.

await BitBadgesApi.getDynamicDataStore("dynamicStore123", { ... });

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner. Alternatively, you can specify the dataSecret.

Authorizations
Path parameters
dynamicStoreIdstringRequired

Dynamic data store ID

Query parameters
dataSecretstringOptional

The data secret to fetch. Only needed if you are not signed in as creator. Not applicable to public stores

Responses
200

Success response

application/json
get
/dynamicStore/{dynamicStoreId}
GET /api/v0/dynamicStore/{dynamicStoreId} HTTP/1.1
Host: api.bitbadges.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "doc": {
    "_docId": "text",
    "_id": "text",
    "handlerId": "email",
    "dynamicDataId": "text",
    "label": "text",
    "dataSecret": "text",
    "data": null,
    "createdBy": "bb1...",
    "managedBy": "bb1...",
    "publicUseInClaims": true,
    "createdAt": "1713301889",
    "lastUpdated": "1713301889"
  }
}

Get Dynamic Data Store Value

get
/dynamicStore/{dynamicStoreId}/value

Gets a value from a dynamic data store by specific ID and key.

await BitBadgesApi.getDynamicDataStoreValue("dynamicStore123", { key: "key123", ... });

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner. You can also specify the dataSecret.

Authorizations
Path parameters
dynamicStoreIdstringRequired

Dynamic data store ID

Query parameters
keystringRequired

The key to fetch.

dataSecretstringOptional

The data secret to fetch. Only needed if you are not signed in as creator. Not applicable to public stores

lookupTypestring Β· enumOptional

The lookup type to fetch (if you need to specify).

Possible values:
Responses
200

Success response

application/json
get
/dynamicStore/{dynamicStoreId}/value
GET /api/v0/dynamicStore/{dynamicStoreId}/value?key=text HTTP/1.1
Host: api.bitbadges.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "key": "text",
  "lookupType": "id",
  "inStore": true
}

Get Dynamic Data Store Values Paginated

get
/dynamicStore/{dynamicStoreId}/values

Gets a paginated list of values from a dynamic data store by specific ID.

await BitBadgesApi.getDynamicDataStoreValuesPaginated("dynamicStore123", { ... });

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner.

Authorizations
Path parameters
dynamicStoreIdstringRequired

Dynamic data store ID

Query parameters
dataSecretstringOptional

The data secret to fetch. Only needed if you are not signed in as creator. Not applicable to public stores

bookmarkstringOptional

The pagination bookmark to start from

lookupTypestring Β· enumOptional

The lookup type to fetch (if you need to specify).

Possible values:
Responses
200

Success response

application/json
get
/dynamicStore/{dynamicStoreId}/values
GET /api/v0/dynamicStore/{dynamicStoreId}/values HTTP/1.1
Host: api.bitbadges.io
x-api-key: YOUR_API_KEY
Accept: */*
{
  "lookupValues": [
    {
      "key": "text",
      "lookupType": "id",
      "inStore": true
    }
  ],
  "pagination": {
    "bookmark": "text",
    "hasMore": true
  }
}

Create Dynamic Data Store

post
/dynamicStores

Creates a new dynamic data store.

await BitBadgesApi.createDynamicDataStore(...);

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner.

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
handlerIdstringRequired

The handler ID for the dynamic data store

Example: email
labelstringRequired

The label of the dynamic data store

publicUseInClaimsbooleanOptional

Whether the dynamic data store should be public. If true, the data can be accessed without authentication. Defaults to false (private).

Responses
200

Success response

application/json
post
/dynamicStores
POST /api/v0/dynamicStores HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "handlerId": "email",
  "label": "text",
  "publicUseInClaims": true
}
{
  "doc": {
    "_docId": "text",
    "_id": "text",
    "handlerId": "email",
    "dynamicDataId": "text",
    "label": "text",
    "dataSecret": "text",
    "data": null,
    "createdBy": "bb1...",
    "managedBy": "bb1...",
    "publicUseInClaims": true,
    "createdAt": "1713301889",
    "lastUpdated": "1713301889"
  }
}

Update Dynamic Data Store

put
/dynamicStores

Updates a dynamic data store.

await BitBadgesApi.updateDynamicDataStore(...);

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner.

Authorizations
Path parameters
dynamicStoreIdstringRequired

Dynamic data store ID

Body
dynamicDataIdstringRequired

The dynamic data ID to update

rotateDataSecretbooleanOptional

Whether to rotate the data secret

labelstringOptional

The new label

Responses
200

Success response

application/json
put
/dynamicStores
PUT /api/v0/dynamicStores HTTP/1.1
Host: api.bitbadges.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 63

{
  "dynamicDataId": "text",
  "rotateDataSecret": true,
  "label": "text"
}
{
  "doc": {
    "_docId": "text",
    "_id": "text",
    "handlerId": "email",
    "dynamicDataId": "text",
    "label": "text",
    "dataSecret": "text",
    "data": null,
    "createdBy": "bb1...",
    "managedBy": "bb1...",
    "publicUseInClaims": true,
    "createdAt": "1713301889",
    "lastUpdated": "1713301889"
  }
}

Delete Dynamic Data Store

delete
/dynamicStores

Deletes a dynamic data store.

await BitBadgesApi.deleteDynamicDataStore(...);

SDK Links:

Scopes:

  • manageDynamicDataStores - Required and must be owner.

Authorizations
Path parameters
dynamicStoreIdstringRequired

Dynamic data store ID

Body
dynamicDataIdstringRequired

The dynamic data ID to delete

Responses
200

Success response

application/json
delete
/dynamicStores
DELETE /api/v0/dynamicStores HTTP/1.1
Host: api.bitbadges.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "dynamicDataId": "text"
}
{
  "message": "text"
}

Perform Single Store Action (Body Auth)

post
/storeActions/single

Performs a single action on a dynamic store using body authentication.

For more information on this route, see the Dynamic Stores > Manage tab in the developer portal.

await BitBadgesApi.performStoreAction(...);

Documentation References / Tutorials:

SDK Links:

Scopes:

  • manageDynamicStores - Required if you do not specify the data secret

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
_isSimulationbooleanOptional

Whether to simulate the action

dynamicDataIdstringRequired

The dynamic data ID

dataSecretstringOptional

The data secret. Needed if you are not signed in as creator. Not applicable to public stores

actionNamestringRequired

The name of the action to perform

Example: add
Responses
200

Success response

application/json
Responseobject
post
/storeActions/single
POST /api/v0/storeActions/single HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Authorization: cookie YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 133

{
  "_isSimulation": true,
  "dynamicDataId": "text",
  "dataSecret": "text",
  "actionName": "add",
  "payload": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
{}

Perform Batch Store Actions (Body Auth)

post
/storeActions/batch

Performs multiple actions on a dynamic store using body authentication.

For more information on this route, see the Dynamic Stores > Manage tab in the developer portal.

await BitBadgesApi.performBatchStoreAction(...);

Documentation References / Tutorials:

SDK Links:

Scopes:

  • manageDynamicStores - Required if you do not specify the data secret

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
_isSimulationbooleanOptional

Whether to simulate the action

dynamicDataIdstringRequired

The dynamic data ID

dataSecretstringOptional

The data secret. Needed if you are not signed in as creator. Not applicable to public stores

Responses
200

Success response

application/json
Responseobject
post
/storeActions/batch
POST /api/v0/storeActions/batch HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Authorization: cookie YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 147

{
  "_isSimulation": true,
  "dynamicDataId": "text",
  "dataSecret": "text",
  "actions": [
    {
      "actionName": "add",
      "payload": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ]
}
{}

Fetch Dynamic Data Stores - Batch

post
/dynamicStores/fetch

Fetches dynamic stores by ID(s).

await BitBadgesApi.getDynamicDataStores(...);

Documentation References / Tutorials:

SDK Links:

Scopes:

  • manageDynamicStores - Required (or specify the valid data secret)

Authorizations
Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Body
dynamicDataIdsstring[]Required

The IDs to fetch. If not provided, all dynamic data stores will be fetched for the current signed in address without any data populated.

dataSecretstringOptional

The data secret to fetch. Only needed if you are not signed in as creator. Not applicable to public stores

Responses
200

Success response

application/json
post
/dynamicStores/fetch
POST /api/v0/dynamicStores/fetch HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Authorization: cookie YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "dynamicDataIds": [
    "text"
  ],
  "dataSecret": "text"
}
{
  "docs": [
    {
      "_docId": "text",
      "_id": "text",
      "handlerId": "email",
      "dynamicDataId": "text",
      "label": "text",
      "dataSecret": "text",
      "data": null,
      "createdBy": "bb1...",
      "managedBy": "bb1...",
      "publicUseInClaims": true,
      "createdAt": "1713301889",
      "lastUpdated": "1713301889"
    }
  ],
  "pagination": {
    "bookmark": "text",
    "hasMore": true
  }
}
get
/dynamicStores/search

Searches for dynamic stores based on the provided criteria. Currently, this only gets the signed in user's dynamic stores.

await BitBadgesApi.searchDynamicDataStores(...);

Documentation References / Tutorials:

SDK Links:

Scopes:

  • manageDynamicStores - Required

Authorizations
Query parameters
bookmarkstringOptional

The pagination bookmark to start from

Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Responses
200

Success response

application/json
get
/dynamicStores/search
GET /api/v0/dynamicStores/search HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Authorization: cookie YOUR_SECRET_TOKEN
Accept: */*
{
  "docs": [
    {
      "_docId": "text",
      "_id": "text",
      "handlerId": "email",
      "dynamicDataId": "text",
      "label": "text",
      "dataSecret": "text",
      "data": null,
      "createdBy": "bb1...",
      "managedBy": "bb1...",
      "publicUseInClaims": true,
      "createdAt": "1713301889",
      "lastUpdated": "1713301889"
    }
  ],
  "pagination": {
    "bookmark": "text",
    "hasMore": true
  }
}

Get Dynamic Data Activity

get
/dynamicStores/activity

Fetches activity history for dynamic stores.

await BitBadgesApi.getDynamicDataActivity(...);

Documentation References / Tutorials:

SDK Links:

Scopes:

  • manageDynamicStores - Required (or specify the valid data secret)

Authorizations
Query parameters
dynamicDataIdstringRequired

The dynamic data ID to fetch activity for

bookmarkstringOptional

The pagination bookmark to start from

dataSecretstringOptional

The data secret to fetch activity for. Needed if you are not signed in as creator. Not applicable to public stores

Header parameters
x-api-keystringRequired

BitBadges API Key for authentication

Responses
200

Success response

application/json
get
/dynamicStores/activity
GET /api/v0/dynamicStores/activity?dynamicDataId=text HTTP/1.1
Host: api.bitbadges.io
x-api-key: text
Authorization: cookie YOUR_SECRET_TOKEN
Accept: */*
{
  "pending": [
    {
      "dynamicDataId": "text",
      "handlerId": "email",
      "actions": [],
      "lastFetchedAt": 1,
      "numRetries": 1,
      "nextFetchTime": 1,
      "error": "text"
    }
  ],
  "history": {
    "docs": [
      {
        "dynamicDataId": "text",
        "updatedAt": 1,
        "actions": []
      }
    ],
    "pagination": {
      "bookmark": "text",
      "hasMore": true
    }
  }
}

Last updated