> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.navipartner.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.navipartner.com/_mcp/server.

# Unblock Membership

POST https://api.npretail.app/{tenant}/{environment}/{company}/membership/{membershipId}/unblock

Unblock a previously blocked membership using this endpoint. It reactivates the membership, allowing members to resume activity after a block period.

Reference: https://docs.navipartner.com/apis/api-reference/memberships/service-membership/unblock-membership

## Authentication

- `x-np-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `tenant` (string, required) — Your Entra Tenant ID. [More details.](/paths#1-tenant)
- `environment` (string, required) — Your Business Central Environment. [More details.](/paths#2-environment)
- `company` (string, required) — Your Business Central Company. [More details.](/paths#3-company)
- `membershipId` (UUID, required) — Unique identifier for a membership.

## Response

### 200

- `membership` (PrimaryMembership, required) — Membership shape returned by the primary membership endpoints — get by id/number, get members, block/unblock, and create. Extends `MembershipEntity` with the full `timeFrames` array. Other membership responses (lifecycle history, lifecycle options, card responses, list) return the base `MembershipEntity` shape without `timeFrames`.

## Types

### PrimaryMembership

Membership shape returned by the primary membership endpoints — get by id/number, get members, block/unblock, and create. Extends `MembershipEntity` with the full `timeFrames` array. Other membership responses (lifecycle history, lifecycle options, card responses, list) return the base `MembershipEntity` shape without `timeFrames`.

- `autoRenewalActivated` (boolean, required) — Indicates if the membership is set to auto-renew.
- `blocked` (boolean, required) — Indicates whether the entity is blocked.
- `communityCode` (string, required) — Code representing the community associated with the membership.
- `issueDate` (date, required) — The date the membership was issued.
- `membershipCode` (string, required) — Code representing the type of membership.
- `membershipDescription` (string, required) — Description of the membership type.
- `membershipId` (UUID, required) — Unique identifier for a membership.
- `membershipNumber` (string, required) — Unique membership number.
- `timeFrames` (list of MembershipTimeFrame, required) — All validity windows for the membership. Use this for the complete picture; the top-level `validFromDate` / `validUntilDate` scalars only describe the frame valid today.
- `attributes` (list of AttributeValueListResponse, optional)
- `blockedAt` (datetime, optional) — Date and time when the entity was blocked.
- `customerNumber` (string, optional) — Customer number associated with the membership.
- `documentId` (string, optional) — Unique identifier for the membership document.
- `validFromDate` (date, optional) — Start of the consecutive frame of the membership that is currently valid. `null` when the frame has no defined start — perpetual memberships, activate-on-first-use memberships that haven't been used yet, or memberships that aren't currently valid.
- `validUntilDate` (date, optional) — End of the consecutive frame of the membership that is currently valid. `9999-12-31` for perpetual memberships. `null` when the frame has no defined end — activate-on-first-use memberships that haven't been used yet, or memberships that aren't currently valid.

### MembershipTimeFrame

A single validity window of the membership. Emitted raw and unmerged in default order — the caller does its own filtering, merging, and ordering. A perpetual membership yields exactly one frame.

- `lifecycleAction` (enum, required) — Lifecycle context for this frame — e.g. `new`, `renew`, `upgrade`, `extend`. `new` is used for the synthetic perpetual frame.
  - Allowed values: `new`, `renew`, `upgrade`, `extend`, `cancel`, `autoRenew`, `regret`
- `membershipCode` (string, required) — Membership code for this frame; may differ across frames on an upgrade or downgrade.
- `blocked` (boolean, required) — Whether the underlying entry is blocked.
- `activateOnFirstUse` (boolean, required) — Whether the entry activates on first use.
- `validFromDate` (date, optional) — Inclusive start of the window. `null` when the underlying date is unset.
- `validUntilDate` (date, optional) — Inclusive end of the window. `9999-12-31` for perpetual; `null` when the underlying date is unset.

### AttributeValueListResponse

This response contains a list of attribute values associated with a specific membership entity.

- `id` (UUID, required)
- `code` (string, required) — The key code for the attribute. This is a unique identifier for the attribute.
- `type` (enum, required) — The datatype of the attribute.
  - Allowed values: `text`, `code`, `date`, `datetime`, `decimal`, `integer`, `boolean`, `unknown`
- `caption` (string, required) — The caption of the attribute.
- `value` (string, required) — The value of the attribute. This is the actual data associated with the attribute.

## Examples

**Response**

```json
{
  "membership": {
    "autoRenewalActivated": true,
    "blocked": false,
    "communityCode": "RIVERLAND",
    "issueDate": "2024-09-17",
    "membershipCode": "GOLD",
    "membershipDescription": "Gold Membership with premium benefits",
    "membershipId": "cdef7890-abcd-0123-1234-567890abcdef",
    "membershipNumber": "MS-DEMO-00152",
    "timeFrames": [
      {
        "lifecycleAction": "new",
        "membershipCode": "GOLD",
        "blocked": false,
        "activateOnFirstUse": false,
        "validFromDate": "2024-09-17",
        "validUntilDate": "2025-09-16"
      }
    ],
    "attributes": [],
    "customerNumber": "D000188",
    "validFromDate": "2024-09-17",
    "validUntilDate": "2025-09-16"
  }
}
```

**SDK Code**

```python ExampleUnblockMembership
import requests

url = "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock"

headers = {"x-np-api-key": "<NaviPartner API Key>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript ExampleUnblockMembership
const url = 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock';
const options = {method: 'POST', headers: {'x-np-api-key': '<NaviPartner API Key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go ExampleUnblockMembership
package main

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

func main() {

	url := "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-np-api-key", "<NaviPartner API Key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby ExampleUnblockMembership
require 'uri'
require 'net/http'

url = URI("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-np-api-key"] = '<NaviPartner API Key>'

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

```java ExampleUnblockMembership
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock")
  .header("x-np-api-key", "<NaviPartner API Key>")
  .asString();
```

```php ExampleUnblockMembership
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock', [
  'headers' => [
    'x-np-api-key' => '<NaviPartner API Key>',
  ],
]);

echo $response->getBody();
```

```csharp ExampleUnblockMembership
using RestSharp;

var client = new RestClient("https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock");
var request = new RestRequest(Method.POST);
request.AddHeader("x-np-api-key", "<NaviPartner API Key>");
IRestResponse response = client.Execute(request);
```

```swift ExampleUnblockMembership
import Foundation

let headers = ["x-np-api-key": "<NaviPartner API Key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.npretail.app/01234567-89ab-cdef-0123-456789abcdef/production/CRONUS%2520International%2520Ltd./membership/cdef7890-abcd-0123-1234-567890abcdef/unblock")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```