Skip to main content

Search Rent Tokens

Search for rent tokens associated with a specific user and token.

Endpoint

POST /v2/users/rents/users/{user_id}/tokens/{token_id}/search

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer {token}

Path Parameters

ParameterTypeRequiredDescription
user_idstringYesThe unique identifier of the user
token_idstringYesThe unique identifier of the token

Request Body

{
"page": 1,
"per_page": 10
}

Parameters

ParameterTypeRequiredDescription
pageintegerYesPage number for pagination
per_pageintegerYesNumber of items per page

Response

Returns a paginated list of rent tokens associated with the user and token.

Success Response (200 OK)

{
"data": [
{
"id": "string",
"user_id": "string",
"token_id": "string",
"deposit_id": "string",
"external_id": "number",
"price": "number",
"contract_created_at": "string",
"created_at": "string",
"updated_at": "string"
}
],
"total": "number",
"page": "number",
"per_page": "number"
}

Response Fields

FieldTypeDescription
idstringUnique identifier of the rent record
user_idstringUnique identifier of the user
token_idstringUnique identifier of the token
deposit_idstringUnique identifier of the deposit
external_idnumberExternal identifier
pricenumberPrice of the rent (null if not set)
contract_created_atstringTimestamp when contract was created (null if not created)
created_atstringTimestamp when the record was created
updated_atstringTimestamp when the record was last updated

Example

Request

curl -X POST "{{baseUrl}}/v2/users/rents/users/680c02896d91ca0145cfeb81/tokens/68ae06cfcccf4e8fc19362d1/search" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"page": 1,
"per_page": 10
}'

Response

{
"data": [
{
"id": "68d6e57c61d63aa6705baacb",
"user_id": "680c02896d91ca0145cfeb81",
"token_id": "68ae06cfcccf4e8fc19362d1",
"deposit_id": "67c918d789486081f8ca5dac",
"external_id": 0,
"price": null,
"contract_created_at": null,
"created_at": "2025-04-21T18:11:23.596Z",
"updated_at": "2025-04-21T18:11:23.596Z"
}
],
"total": 1,
"page": 1,
"per_page": 10
}

Error Responses

400 Bad Request

{
"error": "Invalid request parameters"
}

401 Unauthorized

{
"error": "Authentication required"
}

403 Forbidden

{
"error": "Access denied"
}

404 Not Found

{
"error": "User or token not found"
}

500 Internal Server Error

{
"error": "Internal server error"
}