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

# List Decline Groups

> Lists the decline groups and Merchant Advice Code groups of an account, to reference by group_id from routing outputs.

Lists the decline groups saved on an account: the groups of decline sub-statuses you reference with `status: "DECLINE_GROUP"` and the groups of Merchant Advice Codes you reference with `status: "MAC_CODE_GROUP"`. Use the `id` of a group as `group_id` in a routing output — see [Outcome groups](/reference/organizations/routing/routing-resource-shape#outcome-groups).

The endpoint is read only. Groups are created in the dashboard, or automatically when a `DECLINE_GROUP` output is saved with `decline_types` and no `group_id` (those are named `auto_…`).

### Query Parameters

**account\_id** `string` *required*

The account to list groups for. Must belong to the organization your API credentials are scoped to.

### Response

An array with the groups of the account, or an empty array if it has none. Each group contains:

**id** `integer`

The value to send as `group_id`.

**name** `string`

The group's name, as shown in the dashboard and returned as `group_name` on routing outputs.

**type** `enum`

The output `status` the group is used with: `DECLINE_GROUP` for a group of decline sub-statuses, `MAC_CODE_GROUP` for a group of Merchant Advice Codes.

**decline\_types** `string[]`

The group's members, in the same vocabulary routing outputs use: decline sub-statuses such as `DECLINED_BY_BANK` for `DECLINE_GROUP`, normalized Merchant Advice Codes such as `NO_RETRY_POLICY` for `MAC_CODE_GROUP`. See [Transaction codes](/reference/payments/status-and-response-codes/transaction#declined-status).

```bash cURL theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
curl -X GET 'https://api.y.uno/v1/routing/decline-groups?account_id=7825fc5e-e50a-4248-9ae8-5d3786afb0be' \
  -H 'public-api-key: <YOUR_PUBLIC_KEY>' \
  -H 'private-secret-key: <YOUR_SECRET_KEY>'
```

```json 200 OK theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
[
  {
    "id": 1044,
    "name": "Soft declines",
    "type": "DECLINE_GROUP",
    "decline_types": ["DECLINED_BY_BANK", "RESTRICTED_BY_BANK"]
  },
  {
    "id": 4542,
    "name": "Do not retry",
    "type": "MAC_CODE_GROUP",
    "decline_types": ["NO_RETRY_POLICY", "NO_RETRY_SECURITY"]
  }
]
```

```json 400 Bad Request — Missing account_id theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "ROUTING_VALIDATION_FAILED",
  "messages": ["account_id is required."]
}
```

### Errors

| HTTP | `code` | When |
| - | - | - |
| `400` | `ROUTING_VALIDATION_FAILED` | Missing `account_id` query parameter. |
| `400` | `INVALID_ACCOUNT_ID` | `account_id` belongs to an organization your API key doesn't own. |
| `401` | `NOT_AUTHENTICATED` | Missing `public-api-key` or `private-secret-key` header. |
| `401` | `INVALID_CREDENTIALS` | Wrong key pair, or a Dashboard **Customized API key** was used. Use an account key or organization key instead. |
| `502` | `ROUTING_UPSTREAM_ERROR` | The routing service could not be reached. Retry the request. |


## OpenAPI

````yaml openapi/organizations/routing/list-decline-groups.json GET /routing/decline-groups
openapi: 3.1.0
info:
  title: Routing API - List Decline Groups
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
  - url: https://api.eu.y.uno/v1
    description: Production (EMEA)
security:
  - sec0: []
    sec1: []
paths:
  /routing/decline-groups:
    get:
      summary: List Decline Groups
      description: >-
        Lists the decline groups (DECLINE_GROUP) and Merchant Advice Code groups
        (MAC_CODE_GROUP) of an account, to reference by group_id from routing
        outputs. Read only.
      operationId: list-decline-groups
      parameters:
        - name: account_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            Account to list groups for. Must belong to the organization of your
            API credentials.
      responses:
        '200':
          description: The groups of the account, or an empty array if it has none.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      example: 1044
                      description: The value to send as group_id in a routing output.
                    name:
                      type: string
                      example: Soft declines
                    type:
                      type: string
                      enum:
                        - DECLINE_GROUP
                        - MAC_CODE_GROUP
                      description: The output status the group is used with.
                    decline_types:
                      type: array
                      items:
                        type: string
                      example:
                        - DECLINED_BY_BANK
                        - RESTRICTED_BY_BANK
                      description: >-
                        Members of the group: decline sub-statuses for
                        DECLINE_GROUP, normalized Merchant Advice Codes for
                        MAC_CODE_GROUP.
        '400':
          description: >-
            Bad Request. `ROUTING_VALIDATION_FAILED` when `account_id` is
            missing, `INVALID_ACCOUNT_ID` when it belongs to a different
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_VALIDATION_FAILED
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - account_id is required.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NOT_AUTHENTICATED
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - Not authenticated
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ROUTING_UPSTREAM_ERROR
                  messages:
                    type: array
                    items:
                      type: string
                    example:
                      - routing service unavailable.
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.