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

# Get a webhook portal link

POST https://api.tradeguardins.com/v1/webhooks/portal

Returns a one-time magic link to the hosted webhook portal for the
caller's organization, creating the organization's webhook application
first if needed. In the portal you add and edit endpoints, choose event
types, inspect deliveries and retry failures. Most integrations don't
need this call: the same portal is in the dashboard under
**Settings → Webhooks**, which is where webhook endpoints are set up.
The API has no endpoint CRUD routes.

No request body. Open the URL promptly; request a new one each time.

Requires scope `webhooks:write` (organization admins, or an API key
granted it), because the portal can add endpoints and reveal signing
secrets. Returns `404` if the organization has not been provisioned
yet.


Reference: https://docs.tradeguardins.com/api-reference/webhooks/create-webhook-portal-link

## Authentication

- `Authorization` header (bearer token, required) — Session JWT or API key (`ak_...`)

## Response

### 200

Portal link

- `data` (V1WebhooksPortalPostResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 401 Unauthorized Error

Missing, malformed, expired or revoked credential (`unauthenticated`)

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 403 Forbidden Error

The credential lacks the scope or role for this action (`forbidden`)

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 404 Not Found Error

Resource not found, or not visible to the caller's organization (`not_found`)

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 429 Too Many Requests Error

Rate limit exceeded (`rate_limited`); retry after `Retry-After` seconds

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

### 500 Internal Server Error

Unexpected server error (`internal_error`); safe to retry idempotent requests

- `error` (string, required) — Human-readable message. Wording may change; do not parse it.
- `code` (enum, required) — Stable, machine-readable error code. Status-level codes: `bad_request` (400), `unauthenticated` (401), `forbidden` (403), `not_found` (404), `method_not_allowed` (405, with an `Allow` header), `conflict` (409), `gone` (410), `payload_too_large` (413), `unprocessable` (422), `rate_limited` (429), `internal_error` (500), `bad_gateway` (502), `service_unavailable` (503). Specific codes: `validation_failed` and `invalid_identifier` (400); `reextraction_limit_reached` and `llm_budget_exhausted` (429, document re-extraction only); `sandbox_unavailable` (503, a sandbox key used where the sandbox is not provisioned); `assignment_exists` (409, a live assignment for this subcontractor and project already exists — its id is in `details`), `project_not_ready` (409, the project's setup is not Ready), `project_document` (409, a baseline-only action on a project certificate) and `subcontractor_match` (409, a new subcontractor's email or phone matches one already on TradeGuard — its id is in `details`); `portal_link_expired` and `portal_link_used` (410, sub portal links only).
  - Allowed values: `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `method_not_allowed`, `conflict`, `gone`, `payload_too_large`, `unprocessable`, `rate_limited`, `internal_error`, `bad_gateway`, `service_unavailable`, `validation_failed`, `invalid_identifier`, `reextraction_limit_reached`, `llm_budget_exhausted`, `sandbox_unavailable`, `assignment_exists`, `project_not_ready`, `project_document`, `subcontractor_match`, `portal_link_expired`, `portal_link_used`
- `requestId` (string, optional) — Same value as the `x-request-id` response header.
- `details` (list of ErrorDetailsItems, optional) — Present when `code` is `validation_failed`.

## Types

### V1WebhooksPortalPostResponsesContentApplicationJsonSchemaData

- `url` (string, required) — One-time login link to the webhook portal.

### ErrorDetailsItems

- `path` (string, optional)
- `message` (string, optional)

## Examples

**Response**

```json
{
  "data": {
    "url": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.tradeguardins.com/v1/webhooks/portal"

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.tradeguardins.com/v1/webhooks/portal';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

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

func main() {

	url := "https://api.tradeguardins.com/v1/webhooks/portal"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://api.tradeguardins.com/v1/webhooks/portal")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://api.tradeguardins.com/v1/webhooks/portal")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.tradeguardins.com/v1/webhooks/portal', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.tradeguardins.com/v1/webhooks/portal");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.tradeguardins.com/v1/webhooks/portal")! 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()
```