> ## Documentation Index
> Fetch the complete documentation index at: https://trustos.telefonicatech.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Asset

> Creates a digital asset.



## OpenAPI

````yaml post /assets
openapi: 3.0.1
info:
  title: TrustOS EVM Track API
  description: >-
    TrustOS EVM Track API is used to interact with EVM based blockchain
    networks. In case you have some questions or need more about the use of this
    API, don't hesitate to contact B-Team:
  contact:
    name: Blockchain Team
    email: soporte-bteam@telefonica.com
  version: 2.2.2
servers:
  - url: https://lab.trustos.telefonicatech.com/track/v2
    description: Lab
security: []
tags:
  - name: Asset Creation
    description: Digital asset creation endpoints.
  - name: Asset Management
    description: All about the digital asset lifecycle.
  - name: Utils
    description: Methods for specific use cases.
paths:
  /assets:
    post:
      tags:
        - Asset Creation
      summary: Create an asset.
      parameters:
        - name: networkId
          in: query
          description: Network identifier where the evidence will be registered.
          required: true
          schema:
            type: number
            example: 10004
      requestBody:
        description: Data needed for the creation of an asset.
        content:
          application/json:
            schema:
              type: object
              properties:
                assetId:
                  type: string
                  description: Identifier of the asset.
                  example: asset-test-01
                data:
                  type: object
                  description: Immutable data of the asset.
                  example:
                    id: A2839RP
                    version: '1'
                metadata:
                  type: object
                  description: Metadata related to the asset.
                  example:
                    color: red
                    position:
                      x: '23.34'
                      'y': '-24.22'
              required:
                - assetId
                - data
                - metadata
        required: true
      responses:
        '201':
          $ref: '#/components/responses/201-AssetCreated'
        '400':
          $ref: '#/components/responses/400-ValidationError'
        '401':
          $ref: '#/components/responses/401-AuthenticationError'
        '403':
          $ref: '#/components/responses/403-ForbiddenError'
        '409':
          $ref: '#/components/responses/409-ExistingAssetError'
        '429':
          $ref: '#/components/responses/429-OutOfCreditsError'
        '500':
          $ref: '#/components/responses/500-InternalServerError'
      security:
        - bearerAuth: []
components:
  responses:
    201-AssetCreated:
      description: Successful asset creation.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 201
              message:
                type: string
                description: Message returned by the request.
                example: Asset created
              data:
                $ref: '#/components/schemas/ReturnedAsset'
    400-ValidationError:
      description: Validation error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 400
              type:
                type: string
                description: Error type.
                example: Validation Error
              message:
                type: string
                description: Message returned by the request.
                example: Request parameters are wrong, check requirements
              errors:
                type: array
                description: All the validation errors encountered in the request.
                items:
                  type: object
                  properties:
                    field:
                      type: string
                      description: Name of the field.
                      example: ''
                    error:
                      type: string
                      description: Description of the error encountered.
                      example: ''
    401-AuthenticationError:
      description: Authentication error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 401
              type:
                type: string
                description: Error type.
                example: Authentication Error
              message:
                type: string
                description: Message returned by the request.
                example: Token is not provided
    403-ForbiddenError:
      description: Forbidden error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 403
              type:
                type: string
                description: Type of the error.
                example: Forbidden Error
              message:
                type: string
                description: Message returned by the request.
                example: This certificate requires a PIN, please provide it
    409-ExistingAssetError:
      description: Existing Asset Error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 409
              type:
                type: string
                description: Error type.
                example: Existing Asset Error
              message:
                type: string
                description: Message returned by the request.
                example: >-
                  The provided assetId is already registered, please try again
                  with a different one
    429-OutOfCreditsError:
      description: Out of credits error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 429
              type:
                type: string
                description: Type of the error.
                example: Out of Credits Error
              message:
                type: string
                description: Message returned by the request.
                example: >-
                  User has run out of credits. Please, contact BTeam to increase
                  the limit
    500-InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: number
                description: Request status code.
                example: 500
              type:
                type: string
                description: Error type.
                example: Internal Server Error
              message:
                type: string
                description: Message returned by the request.
                example: Oops! Something went wrong, please try again later
  schemas:
    ReturnedAsset:
      type: object
      properties:
        trackID:
          type: string
          description: Global identifier of the asset.
          example: did:trustos:trackid:<id>
        assetId:
          type: string
          description: Identifier of the asset.
          example: asset-test-01
        data:
          type: object
          description: Immutable data of the asset.
          properties:
            id:
              type: string
              example: A2839RP
            version:
              type: string
              example: '1'
        networkId:
          type: number
          description: Network identifier where the evidence was registered.
          example: 10004
        assetHash:
          type: string
          description: Hash of assetId and data properties.
          example: 6c253e352981fabaf6ba78a301cd116320010a13abe8abf8428eaedcee7ddabd
        transactions:
          type: array
          description: Transactions of the asset.
          items:
            type: object
            properties:
              metadata:
                type: object
                description: Metadata of the last transaction.
                properties:
                  color:
                    type: string
                    example: red
                  position:
                    type: object
                    properties:
                      x:
                        type: string
                        example: '23.34'
                      'y':
                        type: string
                        example: '-24.22'
              timestamp:
                type: integer
                description: Timestamp of the transaction.
                example: 1711538908
              userOwner:
                type: string
                description: Identifier of the user owner of the asset.
                example: did:user:{issuer}
              hash:
                type: string
                description: Hash of metadata, timestamp and userOwner properties.
                example: >-
                  456fc02752e48108af8548b4544c3ab6deb30d091567cff0b5d69a3beda5678d
              smartContract:
                type: string
                description: smart contract where the evidence was registered.
                example: '0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc'
              transactionHash:
                type: string
                description: Identifier of the transaction in the Blockchain network.
                example: >-
                  0x456dbcbff5fa05e060e7dfe3e608cba010d112c75ffbc6531a09b2a1351b3452
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````