---
title: "Retrieve a customer portal session"
description: "The session's lifecycle and timestamps — never a credential."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/payment-methods/retrieve-a-customer-portal-session"
---
# Retrieve a customer portal session

> The session's lifecycle and timestamps — never a credential.

<api-operation method="GET" path="/v1/businesses/{biz}/customers/{cus}/portal_sessions/{id}">
<template v-slot:docs="">

`status` is created → logged_in → logged_out; `revoked_at` is set independently when the session was revoked. `login_at` is when the link was opened, `last_used_at` the latest portal request.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Business id (biz_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        cus
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      Customer id (cus_…)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      psess_… portal session public id
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        portal_session
      </code>
      
      . One of <code>
        portal_session
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The portal session id.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The session state. One of <code>
        created
      </code>
      
      , <code>
        logged_in
      </code>
      
      , <code>
        logged_out
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        link_kind
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      How the link was made: <code>
        api
      </code>
      
       for an API call, <code>
        email
      </code>
      
       for a billing email. One of <code>
        api
      </code>
      
      , <code>
        email
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session was created.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        access_expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the link stops working for a first sign-in.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      The latest time the session can last.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        login_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the customer first opened the link.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        logout_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the customer signed out.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        last_used_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session last made a request.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        revoked_at
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      When the session was revoked, or null.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        redirect_url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Where the portal sends the customer when they leave.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        forward_url
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The portal page the link opens on.
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      Portal session (id, status, link_kind, created_at, access_expires_at, expires_at, login_at, logout_at, last_used_at, revoked_at, redirect_url, forward_url)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such customer, or no such portal session
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/customers/cus_XXXXXXXXXXXX01/portal_sessions/psess_XXXXXXXXXXXX01" \
  -H "Authorization: Bearer $TMBILLING_API_KEY"
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "object": "portal_session",
  "id": "psess_XXXXXXXXXXXX01",
  "status": "logged_in",
  "link_kind": "api",
  "created_at": "2026-03-14T09:30:00Z",
  "access_expires_at": "2026-04-14T09:30:00Z",
  "expires_at": "2026-04-14T09:30:00Z",
  "login_at": "2026-03-14T09:30:00Z",
  "logout_at": "2026-03-14T09:30:00Z",
  "last_used_at": "2026-03-14T09:30:00Z",
  "revoked_at": "2026-03-14T09:30:00Z",
  "redirect_url": "https://app.example.com/billing",
  "forward_url": "/portal?tab=methods"
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such customer, or no such portal session"
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
