# API reference index

# Reference index

Below you can find a reference index of endpoints available on the Trusted Twin environment. Click on a category for a list of endpoints by category.

Path Category POST GET PATCH DELETE
/account account get_account update_account
/account/services/databases databases**** get_databases
/account/services/databases/{databases} databases**** get_database update_database
/account/services/databases/{databases}/access databases**** get_database_access
/account/services/databases/{databases}/access/ips databases**** update_database_ip_access
/account/services/indexes indexes**** create_indexes_table get_indexes_tables update_indexes_access
/account/services/indexes/{index} indexes**** get_indexes_table update_indexes_table delete_indexes_table
/account/services/indexes/{index}/data indexes**** truncate_indexes_table
/account/services/timeseries timeseries**** create_timeseries_table get_timeseries_tables update_timeseries_access
/account/services/timeseries/{timeseries} timeseries**** get_timeseries_table update_timeseries_table delete_timeseries_table
/account/services/timeseries/{timeseries}/data timeseries**** truncate_timeseries_table
/batches batches create_batch get_batches
/batches/{batch} batches get_batch update_batch delete_batch
/cache cache create_upload_url
/cache/{handler} cache invalidate_upload_url
/log log get_log
/notifications/webhooks notifications webhook_subscribe
/notifications/webhooks/{account} notifications webhook_confirm_subscription webhook_refresh_subscription webhook_unsubscribe
/roles role create_user_role get_user_roles
/roles/{role} role get_user_role update_user_role delete_user_role
/secrets/{account}/{pin} user secret create_user_secret
/stickers stickers list_stickers
/token user token create_user_token
/token/refresh user token refresh_user_token
/trace trace trace
/twins twin create_twin scan_twins
/twins/{twin} twin get_twin update_twin terminate_twin
/twins/{twin}/docs doc attach_twin_doc get_twin_docs delete_twin_docs
/twins/{twin}/docs/{doc_name} doc get_twin_doc update_twin_doc delete_twin_doc
/twins/{twin}/identities identity create_twin_identity get_twin_identities
/twins/{twin}/identities/{identity} identity get_twin_identity update_twin_identity delete_twin_identity
/resolve/{identity} identity resolve_twin_identity
/twins/{twin}/ledgers/{ledger} ledger add_twin_ledger_entry* get_twin_ledger_entry*** update_twin_ledger_entry* delete_twin_ledger_entry*
/twins/{twin}/ledgers/{ledger}/history history get_twin_ledger_entry_history**
/twins/{twin}/ledgers/{ledger}/value ledger get_twin_ledger_entry_value** update_twin_ledger_entry_value*
/twins/{twin}/stickers stickers put_sticker get_stickers
/twins/{twin}/stickers/{color} stickers get_sticker remove_sticker
/usage usage get_account_usage
/usage/{user} usage get_user_usage
/users user create_user get_users
/users/{user} user get_user update_user delete_user
/users/{user}/secrets user secret create_user_secret_pin get_user_secret update_user_secret delete_user_secret
/whoami who am i who_am_i

*

The "ledger" parameter in the path of the request should point to the Ledger resource for requests based on the account UUID. Request based on the account UUID can be performed if the Twin rule allows you to perform operations on the given Twin. For requests on personal Ledger, you can use personal instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/personal).

**

The "ledger" parameter in the path of the request should point to the Ledger resource for requests based on the account UUID. Request based on the account UUID can be performed if the Twin rule allows you to perform operations on the given Twin. For requests on personal Ledger, you can use personal instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/personal). For requests on Ledgers where you are the owner of the Twin, you can use owner instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/owner).

***

The "ledger" parameter in the path of the request should point to the Ledger resource for requests based on the account UUID. Request based on the account UUID can be performed if the Twin rule allows you to perform operations on the given Twin. For requests on personal Ledger, you can use personal instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/personal). For requests on Ledgers where you are the owner of the Twin, you can use owner instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/owner). For requests on Ledgers where you are the creator of the Twin, you can use creator instead of the Ledger UUID in the path of the request (/twins/{twin}/ledgers/creator).

****

The advanced database services (Databases, Timeseries and Indexes) need to be enabled for your account. Please contact hello@trustedtwin.com for more details.

# Endpoints

Below you can find a breakdown of endpoints by category. Click on the operation name for comprehensive information about the endpoint.

# Account

Method Path Operation
GET /account get_account
PATCH /account [update_account(../reference/account/update-account.md)

# Batches

Method Path Operation
POST /batches create_batch
GET /batches get_batches
GET /batches/{batch} get_batch
PATCH /batches/{batch} update_batch
DELETE /batches/{batch} delete_batch

# Cache

Method Path Operation
POST /cache create_upload_url
DELETE /cache/{handler} invalidate_upload_url

# Databases*

Method Path Operation*
GET /account/services/databases get_databases
GET /account/services/databases/{database} get_database
PATCH /account/services/databases/{database} update_database
GET /account/services/databases/{database}/access get_database_access
PATCH /account/services/databases/{database}/access/ips update_database_ip_access
PATCH /account/services/databases/{database}/access/users/{user} update_database_user_access

*

The Databases service needs to be enabled for your Account. Please contact hello@trustedtwin.com for more details.

# Docs

Method Path Operation
POST /twins/{twin}/docs attach_twin_doc
GET /twins/{twin}/docs/{doc_name} get_twin_doc
GET /twins/{twin}/docs get_twin_docs
PATCH /twins/{twin}/docs/{doc_name} update_twin_doc
DELETE /twins/{twin}/docs/{doc_name} delete_twin_doc
DELETE /twins/{twin}/docs delete_twin_docs

# History

Method Path Operation
GET /twins/{twin}/ledgers/{ledger}/history get_twin_ledger_entry_history

# Identities

Method Path Operation
POST /twins/{twin}/identities create_twin_identity
GET /twins/{twin}/identities/{identity} get_twin_identity
GET /twins/{twin}/identities get_twin_identities
PATCH /twins/{twin}/identities/{identity} update_twin_identity
DELETE /twins/{twin}/identities/{identity} delete_twin_identity
GET /resolve/{identity} resolve_twin_identity

# Indexes*

Method Path Operation
POST /account/services/indexes create_indexes_table
GET /account/services/indexes/{index} get_indexes_table
GET /account/services/indexes get_indexes_tables
PATCH /account/services/indexes/{index} update_indexes_table
DELETE /account/services/indexes/{index}/data truncate_indexes_table
DELETE /account/services/indexes/{index} delete_indexes_table

*

The Indexes service needs to be enabled for your Account. Please contact hello@trustedtwin.com for more details.

# Ledgers

Method Path Operation
POST /twins/{twin}/ledgers/{ledger} add_twin_ledger_entry
GET /twins/{twin}/ledgers/{ledger}/value get_twin_ledger_entry_value
GET /twins/{twin}/ledgers/{ledger} get_twin_ledger_entry
PATCH /twins/{twin}/ledgers/{ledger}/value update_twin_ledger_entry_value
PATCH /twins/{twin}/ledgers/{ledger} update_twin_ledger_entry
DELETE /twins/{twin}/ledgers/{ledger} delete_twin_ledger_entry

# Log

Method Path Operation
GET /log get_log

# Notifications

Method Path Operation*
POST /notifications/webhooks webhook_subscribe
GET /notifications/webhooks/{account}?token={token} webhook_confirm_subscription
PATCH /notifications/webhooks/{account}?token={token} webhook_refresh_subscription
DELETE /notifications/webhooks/{account}?token={token} webhook_unsubscribe

# Roles

Method Path Operation
POST /roles create_user_role
GET /roles/{role} get_user_role
GET /roles/ get_user_roles
PATCH /roles/{role} update_user_role
DELETE /roles/{role} delete_user_role

# Stickers

Method Path Operation*
POST /twins/{twin}/stickers put_sticker
GET /twins/{twin}/stickers/{color} get_sticker
GET /twins/{twin}/stickers/ get_stickers
GET /stickers list_stickers
DELETE /twins/{twin}/stickers/{color} remove_sticker

# Timeseries*

Method Path Operation*
POST /account/services/timeseries create_timeseries_table
GET /account/services/timeseries/{timeseries} get_timeseries_table
GET /account/services/timeseries get_timeseries_tables
PATCH /account/services/timeseries/{timeseries} update_timeseries_table
DELETE /account/services/timeseries/{timeseries}/data truncate_timeseries_table
DELETE /account/services/timeseries/{timeseries} delete_timeseries_table

*

The Timeseries service needs to be enabled for your Account. Please contact hello@trustedtwin.com for more details.

# Trace

Method Path Operation
POST /trace trace

# Twins

Method Path Operation
POST /twins create_twin
GET /twins/{twin} get_twin
GET /twins scan_twins
PATCH /twins/{twin} update_twin
DELETE /twins/{twin} terminate_twin

# Usage

Method Path Operation*
GET /usage get_account_usage
GET /usage/{usage} get_user_usage

# Users

Method Path Operation
POST /users create_user
GET /users/{user} get_user
GET /users get_users
PATCH /users/{user} update_user
DELETE /users/{user} delete_user

# User Secrets (API keys)

Method Path Operation
POST /users/{user}/secrets create_user_secret_pin
POST /secrets/{account}/{pin} create_user_secret
GET /users/{user}/secrets get_user_secret
PATCH /users/{user}/secrets update_user_secret
DELETE /users/{user}/secrets delete_user_secret

# User Token

Method Path Operation
POST /token create_user_token
POST /token/refresh refresh_user_token

# Who am I

Method Path Operation*
GET /whoami who_am_i

Was this article helpful?