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

# Bulk approve campaign applications

> Approves up to 50 pending applications in one request. Each id is processed independently.

Approves up to **50** pending applications in one request. Each application goes through exactly the same steps as [Approve campaign application](/api-reference/endpoint/approve-campaign-application), including the emails to creators.

<Info>
  Requires a full-access API key (read-only keys are rejected).
</Info>

Each id is processed on its own: valid ids are still approved when another id fails, and failures are listed in `errors`. Ids that are already accepted count as successes with `"changed": false`, so you can safely resend a batch.

## Request body

| Field | Type | Description | Required |
| - | - | - | - |
| `ids` | Array of integers | Application ids, at most 50 | Yes |

## Request example

```bash theme={"dark"}
curl -X POST "https://api.growi.io/api/public/v1/campaign_applications/bulk_approve" \
  -H "Authorization: Bearer YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ids": [98123, 98124, 98125] }'
```

## Response example

```json theme={"dark"}
{
  "success": false,
  "updated": [
    { "id": 98123, "status": "accepted", "campaign_id": 51812, "user_id": 45678, "campaign_affiliate_id": 3490313, "changed": true },
    { "id": 98124, "status": "accepted", "campaign_id": 51812, "user_id": 45679, "campaign_affiliate_id": 3490314, "changed": true }
  ],
  "errors": [
    { "id": 98125, "error": "Application not found." }
  ]
}
```

The response is `200` when every id succeeded and `422` when at least one failed. Both use this shape.

## Response fields

| Field | Type | Description |
| - | - | - |
| `success` | Boolean | `true` when every id succeeded |
| `updated` | Array | One entry per approved application, same fields as `data` in [Approve campaign application](/api-reference/endpoint/approve-campaign-application) |
| `errors` | Array | One entry per failed id, with `id` and `error` |

## Error responses

**403: read-only API key**

```json theme={"dark"}
{ "error": "This API key is read-only and cannot modify data." }
```

**422: missing or too many ids**

```json theme={"dark"}
{ "error": "Maximum 50 applications per request." }
```

<RequestExample>
  ```bash cURL theme={"dark"}
  curl -X POST "https://api.growi.io/api/public/v1/campaign_applications/bulk_approve" \
    -H "Authorization: Bearer YOUR_PUBLIC_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "ids": [98123, 98124] }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"dark"}
  {
    "success": true,
    "updated": [
      { "id": 98123, "status": "accepted", "campaign_id": 51812, "user_id": 45678, "campaign_affiliate_id": 3490313, "changed": true },
      { "id": 98124, "status": "accepted", "campaign_id": 51812, "user_id": 45679, "campaign_affiliate_id": 3490314, "changed": true }
    ],
    "errors": []
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /campaign_applications/bulk_approve
openapi: 3.0.1
info:
  title: Growi API
  description: >-
    API documentation for Growi platform, showcasing the public tracking event
    endpoint
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.growi.io/api/public/v1
security:
  - bearerAuth: []
paths:
  /campaign_applications/bulk_approve:
    post:
      summary: Bulk Approve Campaign Applications
      description: >-
        Approves up to 50 pending applications in one request. Each id is
        processed independently.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ids
              properties:
                ids:
                  type: array
                  maxItems: 50
                  items:
                    type: integer
                  example:
                    - 98123
                    - 98124
                  description: Application ids
      responses:
        '200':
          description: Every application approved
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: true when every id succeeded
                  updated:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        status:
                          type: string
                        campaign_id:
                          type: integer
                        user_id:
                          type: integer
                        campaign_affiliate_id:
                          type: integer
                          nullable: true
                        changed:
                          type: boolean
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        error:
                          type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Read-only API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            One or more ids failed (the rest were still processed), ids is
            missing, or more than 50 ids were sent
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: true when every id succeeded
                  updated:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        status:
                          type: string
                        campaign_id:
                          type: integer
                        user_id:
                          type: integer
                        campaign_affiliate_id:
                          type: integer
                          nullable: true
                        changed:
                          type: boolean
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        error:
                          type: string
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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