---
title: "Cancel an agreement for recurring payments"
method: POST
path: "/v1/agreements/{agreementId}/cancel"
tags: ["Agreements"]
---

# Cancel an agreement for recurring payments

`POST /v1/agreements/{agreementId}/cancel`

## Request

- Base URL: `https://publicapi.payments.service.gov.uk`
- URL: `https://publicapi.payments.service.gov.uk/v1/agreements/{agreementId}/cancel`
- Auth: HTTP bearer

You can use this endpoint to cancel a recurring payments agreement in the `active` status.

## Path parameters

- `agreementId` string, required

## Response `204`

No Content

## Other responses

- `400`: Cancellation of agreement failed
- `401`: Your API key is missing or invalid. Read more about [authenticating GOV.UK Pay API requests](https://docs.payments.service.gov.uk/api_reference/#authentication)
- `404`: Not found
- `429`: Too many requests
- `500`: Downstream system error

## Changes

- **2023-04-18** `c8f226fc66d4`: 3 info
  - added the optional property `header` to the response with the `400` status
  - added the optional property `header` to the response with the `404` status
  - added the optional property `header` to the response with the `500` status
- **2023-02-08** `3917b606b0dd`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/government-digital-service/apis/gov-uk-pay-api/changes/v1/agreements/:agreementId/cancel/post.md)

---

[API](https://skmtc.dev/government-digital-service/apis/gov-uk-pay-api.md) - [All operations](https://skmtc.dev/government-digital-service/apis/gov-uk-pay-api/llms.txt) - [OpenAPI document](https://skmtc.dev/government-digital-service/apis/gov-uk-pay-api/revisions/6dc4b2c91eb8?raw)
