---
title: Signoff (POST)
description: Initiate user logout from PingOne with a POST request body specifying the current session cookie and an optional ID token hint
component: pingone-api
page_id: pingone-api:auth:openid-connect-oauth-2/authorization/signoff-post
canonical_url: https://developer.pingidentity.com/pingone-api/auth/openid-connect-oauth-2/authorization/signoff-post.html
llms_txt: https://developer.pingidentity.com/pingone-api/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
page_aliases: ["auth:openid-connect-oauth-2/signoff-post.adoc"]
section_ids:
  headers: Headers
  body: Body
  example-request: Example Request
  example-response: Example Response
---

# Signoff (POST)

##

```none
POST {{authPath}}/{{envID}}/as/signoff
```

Use `POST /{{envID}}/as/signoff` to initiate user logout with optional parameters specified in the request body. The `Cookie` request header specifies the current session token.

The request body can include an optional parameter `id_token_hint` specifying the ID token passed to the logout endpoint as a hint about the user's current authenticated session. The application identified by the ID token must exist, and must not be disabled. The user identified by the ID token must be the user identified by the current session.

The `id_token_hint` value is validated as follows:

* It must be signed by an application identified in the `aud` claim.

* The `iss` claim must match the authorization server URL used for the `/signoff` request:

  * If a custom domain is used (the URL is `https://<custom domain="">/as/signoff`), the `iss` claim must be `https://<custom domain="">/as.</custom></custom>`.

  * The geographic domain specified in the URL (`https://auth.pingone.[tld]/{envId}/as/signoff)`, must be `https://auth.pingone.[tld]/{envID}/as` in the `iss` claim.

|   |                                                               |
| - | ------------------------------------------------------------- |
|   | The `id_token_hint` value can be used even if it has expired. |

The endpoint returns a `302 Found` message with the following confirmation URL in the `Location` header:

```
https://apps.pingone.com/{{envID}}/signon/#signedOff
```

For more information about PingOne SSO sessions and sign off, refer to [Sessions](../../../platform/sessions.html).

> **Collapse: Request Model**
>
> Refer to [OpenID Connect/OAuth 2](../../openid-connect-oauth-2.html) for complete property descriptions.
>
> | Property                   | Type   | Required |
> | -------------------------- | ------ | -------- |
> | `id_token_hint`            | String | Optional |
> | `post_logout_redirect_uri` | String | Optional |
> | `state`                    | String | Optional |
>
> For the user to be redirected successfully, `post_logout_redirect_uri` and `state` must have a combined value of less than 8192 characters.

### Headers

Content-Type      application/x-www-form-urlencoded

Cookie      {{sessionToken}}

### Body

urlencoded ( application/x-www-form-urlencoded )

##

### Example Request

* cURL

* C#

* Go

* HTTP

* Java

* jQuery

* NodeJS

* Python

* PHP

* Ruby

* Swift

```shell
curl --location --globoff --request POST '{{authPath}}/{{envID}}/as/signoff' \
--header 'Cookie: {{sessionToken}}' \
--header 'Content-Type: application/x-www-form-urlencoded'
```

```csharp
var options = new RestClientOptions("{{authPath}}/{{envID}}/as/signoff")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Cookie", "{{sessionToken}}");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
```

```golang
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "{{authPath}}/{{envID}}/as/signoff"
  method := "POST"

  payload := strings.NewReader("")

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Cookie", "{{sessionToken}}")
  req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

```http
POST /{{envID}}/as/signoff HTTP/1.1
Host: {{authPath}}
Cookie: {{sessionToken}}
Content-Type: application/x-www-form-urlencoded
```

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{authPath}}/{{envID}}/as/signoff")
  .method("POST", body)
  .addHeader("Cookie", "{{sessionToken}}")
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .build();
Response response = client.newCall(request).execute();
```

```javascript
var settings = {
  "url": "{{authPath}}/{{envID}}/as/signoff",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Cookie": "{{sessionToken}}",
    "Content-Type": "application/x-www-form-urlencoded"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

```javascript
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{authPath}}/{{envID}}/as/signoff',
  'headers': {
    'Cookie': '{{sessionToken}}',
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  form: {

  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

```python
import requests

url = "{{authPath}}/{{envID}}/as/signoff"

payload = {}
headers = {
  'Cookie': '{{sessionToken}}',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{authPath}}/{{envID}}/as/signoff');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Cookie' => '{{sessionToken}}',
  'Content-Type' => 'application/x-www-form-urlencoded'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

```ruby
require "uri"
require "net/http"

url = URI("{{authPath}}/{{envID}}/as/signoff")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Cookie"] = "{{sessionToken}}"
request["Content-Type"] = "application/x-www-form-urlencoded"

response = http.request(request)
puts response.read_body
```

```swift
let parameters = ""
let postData =  parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{authPath}}/{{envID}}/as/signoff")!,timeoutInterval: Double.infinity)
request.addValue("{{sessionToken}}", forHTTPHeaderField: "Cookie")
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")

request.httpMethod = "POST"
request.httpBody = postData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
  guard let data = data else {
    print(String(describing: error))
    return
  }
  print(String(data: data, encoding: .utf8)!)
}

task.resume()
```

### Example Response

302 Found
