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

# Set AT credentials

> Set or update the AT web services credentials for a given supplier.

This endpoint allows to set or update the AT web services credentials for a supplier. Credentials are validated against the AT Series web service before being stored to ensure they are correct and active. These credentials are necessary to register series and send documents to the AT via web services.


## OpenAPI

````yaml POST /apps/at-pt/v1/entry/{silo_entry_id}/credentials
openapi: 3.1.0
info:
  contact:
    email: dev@invopop.com
    name: Invopop Developers
  description: Set of end-points to interact with the AT Portugal app API.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  title: Portugal AT Service API
  version: 0.1.0
servers:
  - description: production
    url: https://api.invopop.com
security:
  - InvopopAuth: []
paths:
  /apps/at-pt/v1/entry/{silo_entry_id}/credentials:
    post:
      description: Set or update the AT web services credentials for a given supplier.
      parameters:
        - description: Silo entry ID of the supplier to set the credentials for.
          in: path
          name: silo_entry_id
          required: true
          schema:
            description: Silo entry ID of the supplier to set the credentials for.
            example: 347c5b04-cde2-11ed-afa1-0242ac120002
            title: Silo Entry ID
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                username:
                  description: AT username.
                  example: 599999993/37
                  title: Username
                  type: string
                password:
                  description: AT password.
                  example: MySecretPassword123
                  format: password
                  title: Password
                  type: string
              required:
                - username
                - password
              type: object
        required: true
      responses:
        '204':
          description: Credentials updated successfully.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Invalid parameters.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Supplier not found.
        '422':
          description: Invalid credentials (not validated against AT).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error.
components:
  schemas:
    Error:
      properties:
        message:
          description: Details of the error.
          title: Message
          type: string
      type: object
  securitySchemes:
    InvopopAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Use the `Bearer` scheme with a valid JWT token to authenticate requests.

        Example: `Authorization: Bearer <token>`

````