Content Server

Decentraland is a virtual world that is owned by its users. One of the biggest differentiators about Decentraland is its level of decentralization. Users can own LAND, wearables, and probably other types of items in the future. Each of these items is an NFT in itself, and therefore ownership is determined by the Ethereum (or EVM-compatible) blockchain. Now, when a new wearable is created, or when a user uploads a scene to their LAND/parcel, all necessary files (3d models, textures, music, etc) are uploaded to a "content server". Why are we using these servers instead of the blockchain? Mainly because it would be prohibitively expensive to store files as big as 3d models in the blockchain. Users would have to pay fees so high to upload content to their parcels that nobody would do it. So this is where content servers come into play. The content server is mainly a server where users can upload these files we mentioned before. Each server will verify against the blockchain that the user making the upload is actually allowed to do so. For example, in the case of scenes, the server will check that the deployer owns all the parcels they are trying to modify. And the most important part is that all content servers will then sync with each other. So, for example, if a scene is modified in one server, the update itself will be broadcasted to the other ones. Then, in the case a content server goes down for some reason, all content will still be present in the other ones.

Get information about an entity

get
/content/audit/{entityType}/{entityId}

Get information about an entity, such us Scenes Profiles or Wearables, with the specified entityId.

Path parameters
entityTypestring · enumRequired

Specify the type of entity to audit

Example: profilePossible values:
entityIdstringRequired

id of the entity

Example: QmQgezF4UWTZpD5VqKs2AGCzucRJdm8zU87MxdSRH9heZR
Responses
chevron-right
200

Entity version, AuthChain and if the deployment was overwritten

application/json; charset=utf-8
get
/content/audit/{entityType}/{entityId}

Validate if the Server is part of the DAO

get
/content/challenge

Used by the Server to figure out their identity on the DAO by themselves, so they will generate a random challenge text, and then query each server for it. If the text matches, then they have found themselves.

Responses
chevron-right
200

Challenge text

application/json; charset=utf-8
get
/content/challenge
200

Challenge text

Download content file

get
/content/contents/{hashId}

Download the binary file associated with the specified hashId

Path parameters
hashIdstringRequired

Hash of the file to be retrieved, you can search for the hashId in the content section of a deployment. If the entity version greater than or equal to v4, then the hashing algorithm will be IPFS, if the entity version is v3 or below then it will be SHA-256

Example: QmVzr55TyXcrbQUWBN6rf7K7zkZsTFnBK19LvgYM9CxFbu
Responses
chevron-right
200

Binary file with the specified hashId

application/octet-stream
Responsestring · binaryExample: binary
get
/content/contents/{hashId}

Check if a content file exists

head
/content/contents/{hashId}

Check if a content file exists

Path parameters
hashIdstringRequired

Hash of the file to be checked

Example: QmVzr55TyXcrbQUWBN6rf7K7zkZsTFnBK19LvgYM9CxFbu
Responses
chevron-right
200

Content file exists

head
/content/contents/{hashId}

No content

List of entityIds associated with a hashId

get
/content/contents/{hashId}/active-entities

Get the list of entity ids whose deployments are associated with the specified content hash. This endpoint is currently intended for troubleshooting as there is no specific use case for it.

Path parameters
hashIdstringRequired

Hash of the content file

Example: QmWFLwHGfvhB9a1epaRpS38HEwbHvhpaYzHEsNhDRgon7P
Responses
chevron-right
200

List of all the entities associated with the hashId

application/json; charset=utf-8
Responsestring[]
get
/content/contents/{hashId}/active-entities

Validates if file exists on the Server

get
/content/available-content

Given a list of hashes, validates if the corresponding files exist in the storage of the server

Query parameters
cidstring[]Required

Hash of the content file

Example: QmWFLwHGfvhB9a1epaRpS38HEwbHvhpaYzHEsNhDRgon7P
Responses
chevron-right
200

List of objects with the hasIds and a boolean value specifying 'true' if the files exists on the server and 'false' if it doesn't.

application/json; charset=utf-8
get
/content/available-content

Deploys an entity

post
/content/entities

Deploys an entity in the content server. This request must contain a file with the entity itself and also the files associated with it, such as 3D models, as well as information about the entity and requester. This request will succeed only if the hash of the entity file matches the entityId and also if the signature is valid has the correct permission to modify the pointers associated with it.

Body
filesstring · binary[]Optional
entityIdstringOptionalExample: QmY4GFuf2jR3ocfuXuFLgvUrGEpjo84Byg44Pv2wduuinW
authChainstringOptionalExample: [{"type":"SIGNER","payload":"0x716954738e57686a08902d9dd586e813490fee23"},{"type":"ECDSA_EPHEMERAL","payload":"Decentraland Login\nEphemeral address: 0x90a43461d3e970785B945FFe8f7628F2BC962D6a\nExpiration: 2021-07-10T20:55:42.215Z","signature":"0xe64e46fdd7d8789c0debec54422ae77e31b77e5a28287e072998e1114e252c57328c17756400d321e9e77032347c9d05e63fb59a3b6c3ab754565f9db86b8c481b"},{"type":"ECDSA_SIGNED_ENTITY","payload":"QmNMZBy7khBxdigikA8mcJMyv6yeBXfMv3iAcUiBr6n72C","signature":"0xbed22719dcdc19580353108027c41c65863404879592c65014d806efa961c629777adc76986193eaee4e48f278ec59feb1c289827254230af85b2955157ec8061b"}]
ethAddressstringOptionalExample: 0x89205A3A3b2A69De6Dbf7f01ED13B2108B2c43e7
signaturestringOptional
Responses
chevron-right
200

Entity created successfully. The response will contain the timestamp and result.

application/json; charset=utf-8
post
/content/entities

List of active entities matching urn prefix

get
/content/entities/active/collections/{collectionUrn}

Returns the list of active entities which have at least one pointer that matches the prefix given

Path parameters
collectionUrnstringRequired

urn prefix to filter the entities by

Example: urn:decentraland:matic:collections-v2:0x8e674db9b2fc0759b2d94cace9c4bae334a8f0c3
Query parameters
pageSizenumberOptional

Page size (max 1000)

pageNumbernumberOptional

Page number (default: 1)

Responses
chevron-right
200

List of entity Ids matching the condition

application/json; charset=utf-8
get
/content/entities/active/collections/{collectionUrn}
200

List of entity Ids matching the condition

List active entities by pointers or ids

post
/content/entities/active

Returns the list of entities of the specified type with the specified id or pointers. Only one of these filters must be specified in the body.

Body
pointersstring[]Optional

Entities must be filtered by pointer XOR entityId (ids). Use this parameter if you want to retrieve an entity of the specified type with this pointer.

Example: urn:decentraland:mumbai:collections-v2:0xf6426e0c70c17509038aba78137e721d187499d6:0
idsstring[]Optional

Entities must be filtered by pointer (pointers) XOR entityId. Use this parameter if you want to retrieve an entity of the specified type with this entityId.

Example: QmeA8RpAtqU6gCebNaWRXtM9nQs3ugzzbeQm3L7uKrP4Jp
Responses
chevron-right
200

List of entities corresponding to the matching ids or pointers.

application/json; charset=utf-8
post
/content/entities/active

List of failed deployments

get
/content/failed-deployments

Retrieves a list of the failed deployments

Responses
chevron-right
200

Failed deployments list

application/json; charset=utf-8
get
/content/failed-deployments
200

Failed deployments list

List of changes made to a pointer

get
/content/pointer-changes

List of all deltas from the deployments inside the filters that affect the given pointers. It returns a list of changes with the before field (the entity that was overridden with this deployment) and after (the entity that overrides the current one if present).

Query parameters
fromintegerOptional

Acts as a filter in the collection of deployments, this value is the minimum value of local timestamp that any deployment in the collection will have.

Example: 1606829553969
tointegerOptional

Acts as a filter in the collection of deployments, this value is the maximum value of local timestamp that any deployment in the collection will have.

Example: 1606829553969
lastIdstringOptional

It is the last entity id that was visited, so it will be skipped when showing current page.

Example: QmNknKv8MuKbfZ73z4QdUEsNbTd1ZAN1fSuwTFGiNGeCt5
limitintegerOptional

The deployments are a paginated collection, this parameter corresponds to the limit for each page. The default value is 500.

Example: 100
entityTypestring · enumOptional

The type of entities that will be shown in the collection, many values can be sent. Valid values are: profile, scene and wearable.

Example: profilePossible values:
sortingFieldstring · enumOptional

This value is used as the field to order all the deployments in the collection. If no parameter is sent, then the default field to order with will be local_timestamp.

Example: local_timestampPossible values:
sortingOrderstring · enumOptional

This value is used as the order for all the deployments in the collection. If no parameter is sent, then the default field to order with will be DESC.

Example: ASCPossible values:
Responses
chevron-right
200

List of deployment changes made to pointers

application/json; charset=utf-8
get
/content/pointer-changes

Snapshots with a list of active entities

get
/content/snapshots

Lists all active deployments stored in the database in multiple snapshots for different time ranges. If the information needed is front in time of the most recent snapshot, you may use the /content/pointer-changes endpoint with the necessary from filter.

Responses
chevron-right
200

The result is a list of snapshots. Each "hash" field references the a snapshot with all the active entities that has an entity timestamp within the specified time range. Each hash is a reference to a JSON file containing one line per entity in a JSON format. Once you get the hashes you can download them using the /content/contents/{hashId} endpoint.

application/json; charset=utf-8
get
/content/snapshots

Content Server status

get
/content/status

Retrieve deteailed information about the content server status

Responses
chevron-right
200

Content Server status information

application/json; charset=utf-8
get
/content/status
200

Content Server status information

Last updated