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

# Credentials

> Store and manage portal credentials for tax filing and compliance automation.

## Overview

The Credentials API provides secure storage for login credentials to government tax portals. Credentials are used by Commenda to file tax returns on your behalf when managed filing is enabled on a registration.

Each credential contains one or more **blocks** — structured key-value pairs that store individual fields like usernames, passwords, and account numbers.

## Credential types

| Type                        | Description                                                  |
| --------------------------- | ------------------------------------------------------------ |
| `INDIRECT_TAX_REGISTRATION` | Credentials for a tax filing portal linked to a registration |
| `OTHER`                     | General-purpose credentials                                  |

## Block types

| Type           | Description                                   |
| -------------- | --------------------------------------------- |
| `String`       | Plain text value (usernames, account numbers) |
| `SecureString` | Encrypted value (passwords, PINs)             |
| `File`         | File attachment (certificates, keys)          |

## Credential statuses

| Status    | Description                              |
| --------- | ---------------------------------------- |
| `ACTIVE`  | Credential is valid and in use           |
| `EXPIRED` | Credential has expired and needs renewal |

## Workflow

<Steps>
  <Step title="Get portal requirements">
    Use the [Portal Fields](/engine/indirect-tax/registrations/v2/content/portal-fields-POST) endpoint to see what credential fields a portal requires.
  </Step>

  <Step title="Create a credential">
    Use the [Create Credential](/engine/indirect-tax/credentials/credentials-POST) endpoint to store the portal login details.
  </Step>

  <Step title="Link to a registration">
    Pass the `credential_id` when [creating](/engine/indirect-tax/registrations/v2/registrations-v2-POST) or [updating](/engine/indirect-tax/registrations/v2/registrations-v2-id-POST) a V2 registration.
  </Step>
</Steps>

## API endpoints

| Endpoint                                                                      | Method | Description                        |
| ----------------------------------------------------------------------------- | ------ | ---------------------------------- |
| [`/credentials`](/engine/indirect-tax/credentials/credentials-POST)           | POST   | Create a new credential            |
| [`/credentials`](/engine/indirect-tax/credentials/credentials-GET)            | GET    | List credentials for a corporation |
| [`/credentials/{id}`](/engine/indirect-tax/credentials/credentials-id-GET)    | GET    | Get a single credential            |
| [`/credentials/{id}`](/engine/indirect-tax/credentials/credentials-id-POST)   | POST   | Update a credential                |
| [`/credentials/{id}`](/engine/indirect-tax/credentials/credentials-id-DELETE) | DELETE | Delete a credential                |

## Extending list responses

When listing credentials, you can include additional portal details by passing `extend=PORTAL_DETAILS` as a query parameter. This adds the portal name, URL, and jurisdiction information to each credential in the response.
