> ## 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.

# Change Access Properties

> Changes the access properties of a certificate.

## Use Cases

#### Make a certificate public

In order to make a certificate public, the body property `public` should be set to `true`.

#### Make a certificate private or change the certificate pin

In order to make a certificate private or change the certificate PIN, the body property `certificatePin` should be passed with the desired PIN.

#### Change externalId

In order to change the externalId of a certificate, the body property `externalId` should be passed with the desired externalId.

#### Delete externalId

In order to delete the externalId of a certificate, the body property `externalId` should be passed with `null`.


## OpenAPI

````yaml patch /certificates/{type}/{id}
openapi: 3.0.1
info:
  title: TrustOS EVM Cert API
  description: >-
    TrustOS EVM Cert 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.6.0
servers:
  - url: https://lab.trustos.telefonicatech.com/cert/v2
    description: Lab
security: []
tags:
  - name: Certificate Generation
    description: Methods for generating certificates.
  - name: Certificate Management
    description: Basic methods about certificates.
  - name: Qualified Signature
    description: Methods for generating qualified signatures.
  - name: Utils
    description: Methods for specific use cases.
paths:
  /certificates/{type}/{id}:
    patch:
      tags:
        - Certificate Management
      summary: Change access properties of a certificate.
      parameters:
        - name: type
          in: path
          description: Type of the certificate identifier.
          required: true
          schema:
            type: string
            enum:
              - certID
              - externalId
              - fileHash
              - hash
        - name: id
          in: path
          description: Identifier of the certificate.
          required: true
          schema:
            type: string
            example: '123'
        - name: pin
          in: query
          description: PIN of the certificate (if the certificate is private).
          required: false
          schema:
            type: string
            example: '1234'
      requestBody:
        description: Data needed to change the access properties of a certificate.
        content:
          application/json:
            schema:
              type: object
              properties:
                public:
                  type: boolean
                  description: >-
                    Flag that indicates whether the certificate must be public
                    or not.
                  example: true
                certificatePin:
                  type: string
                  description: New PIN of the certificate.
                  example: '1234'
                externalId:
                  type: string
                  description: New custom identifier of the certificate.
                  example: extcertid
        required: true
      responses:
        '200':
          $ref: '#/components/responses/200-CertificateAccessPropsUpdated'
        '400':
          $ref: '#/components/responses/400-ValidationError'
        '401':
          $ref: '#/components/responses/401-AuthenticationError'
        '403':
          $ref: '#/components/responses/403-ForbiddenError'
        '404':
          $ref: '#/components/responses/404-NotFoundError'
        '500':
          $ref: '#/components/responses/500-InternalServerError'
      security:
        - bearerAuth: []
components:
  responses:
    200-CertificateAccessPropsUpdated:
      description: Successful certificate access properties update.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
                description: Request status code.
                example: 200
              message:
                type: string
                description: Message returned by the request.
                example: Certificate access properties updated
              data:
                type: object
                description: Data returned by the request.
                example: >-
                  The access properties of the certificate with certID
                  'did:<env>:certid:<id>' have been updated.
    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: Type of the error.
                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: Type of the error.
                example: Authentication Error
              message:
                type: string
                description: Message returned by the request.
                enum:
                  - User credentials are wrong
                  - Token is invalid
                  - Token is expired
                  - 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.
                enum:
                  - >-
                    User is not qualified, please try again with a qualified
                    user
                  - This certificate requires a PIN, please provide it
                  - >-
                    Provider not available in your plan. Please, contact B-Team
                    to include it
    404-NotFoundError:
      description: Not found error.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
                description: Request status code.
                example: 404
              type:
                type: string
                description: Type of the error.
                example: Not Found Error
              message:
                type: string
                description: Message returned by the request.
                enum:
                  - Certificate with certId {certId} not found
                  - Certificate with externalId {externalId} not found
                  - Certificate with fileHash {fileHash} not found
    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: Type of the error.
                example: Internal Server Error
              message:
                type: string
                description: Message returned by the request.
                example: Oops! Something went wrong, please try again later
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````