Token Metadata API

Locksmith provides facilities to host and retrieve token metadata associated with Locks and its key holders.

get
Get Key Metadata (NFT Metadata)

https://locksmith-host/api/key/:lockAddress/:keyId
This endpoint returns metadata associated with an associated key.
Request
Response
Request
Path Parameters
lockAddress
required
string
Lock contract address
keyId
required
string
ID of the cake to get, for free of course.
Headers
Authentication
optional
string
Authentication token to track down who is emptying our stocks.
Query Parameters
data
optional
string
Data associated with the provided signature
Response
200: OK
Returns metadata associated with requested key (NFT)
{
"name": "Blue Checkmark",
"description": "A blue checkmark for all of your social web accounts! Unlock is a protocol for memberships. https://unlock-protocol.com/",
"image": "https://assets.unlock-protocol.com/nft-images/blue-checkmark.png",
"attributes": [
{
"trait_type": "Expiration",
"value": 4720101493,
"display_type": "date"
}
]
}
404: Not Found
Key does not exist

get
Get Key Holder Metadata for a Key Holders

https://locksmith-host/api/key/:address/keyHolderMetadata
Provides lock owners with key holder provided metadata in bulk
Request
Response
Request
Path Parameters
address
required
string
Lock contract address
Headers
Authorization
required
string
Query Parameters
data
required
string
Data associated with the provided signature
Response
200: OK
[{
tokenAddress: lockAddress,
userAddress: lockOwningAddress,
data: {
protected: {
hidden: 'metadata',
},
public: {
mock: 'values',
},
},
}]
401: Unauthorized
If an authorization header is not provided, if the signee of the provided payload does not match the lock owner, the signature has expired or if a payload is not provided the request will be deemed unauthorized

put
Update Lock's default Metadata

https://locksmith-host/api/key/:address
Allows Lock owners with the ability to update default metadata to be shared with all keys of a given Lock.
Request
Response
Request
Path Parameters
address
required
string
Lock's contract address
Headers
Authorization
required
string
Body Parameters
required
object
Structured data with update details
Response
202: Accepted
The metadata has been update
400: Bad Request
An unknown issue occurs when attempting to persist the update
401: Unauthorized
The request does not contain a valid signature or is missing a payload

put
Update a Key's Metadata

https://locksmith-host/api/key/:address/:keyId
Provides lock owners with the ability to update metadata associated with specific keys.
Request
Response
Request
Path Parameters
address
required
string
Lock's contract address
keyId
required
string
Id of key to be updated
Headers
Authorization
required
string
Body Parameters
required
object
Response
202: Accepted
400: Bad Request
401: Unauthorized

put
Update a User's Metadata Associated with keys of a give Lock

https://locksmith-host/api/key/:address/user/:userAddress
Key holders are allowed to update metadata associated with keys of a given lock in support of downstream use cases. Lock owners will have access to protected information provided by key holders.
Request
Response
Request
Path Parameters
address
required
string
userAddress
required
string
Headers
Authorization
required
string
Body Parameters
required
object
Response
200: OK
401: Unauthorized