Delete a content block
curl --request DELETE \
--url https://app.sajn.se/api/v1/blocks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sajn.se/api/v1/blocks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sajn.se/api/v1/blocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sajn.se/api/v1/blocks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/blocks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.sajn.se/api/v1/blocks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/blocks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cm4k2x9p10028abcd1234efgh",
"deleted": true
}{
"code": "INVALID_API_VERSION",
"message": "Unknown API version \"2026-13\". Supported versions: 2026-09, 2026-10.",
"userMessage": "API-versionen finns inte.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "UNAUTHORIZED",
"message": "Invalid API token",
"userMessage": "Ogiltig API-nyckel",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "INSUFFICIENT_SCOPE",
"message": "Insufficient OAuth scope: requires documents:write",
"userMessage": "Applikationen saknar behörighet (scope) för denna åtgärd.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2",
"requiredScopes": [
"documents:write"
],
"grantedScopes": [
"profile:read"
]
}{
"code": "NOT_FOUND",
"message": "Block not found",
"userMessage": "Resursen hittades inte.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2",
"resource": "block"
}{
"code": "INVALID_STATE",
"message": "The resource's current state doesn't allow the operation, such as editing a document that was already sent or downloading a file that isn't produced yet.",
"userMessage": "Åtgärden är inte möjlig i resursens nuvarande status.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "RATE_LIMITED",
"message": "API rate limit exceeded",
"userMessage": "För många förfrågningar. Försök igen om en stund.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "INTERNAL_ERROR",
"message": "Internal server error",
"userMessage": "Något gick fel.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "UPSTREAM_UNAVAILABLE",
"message": "A service the operation depends on, such as an eID provider or a connected integration, failed or is unavailable. Retry with exponential backoff.",
"userMessage": "En extern tjänst svarar inte just nu. Försök igen om en stund.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}Blocks
Delete a content block
Delete a content block. PRIVATE blocks can only be deleted by their creator. WORKSPACE and ORGANIZATION blocks can be deleted by their creator or an organization administrator. sajn-curated globals cannot be deleted via the API.
DELETE
/
api
/
v1
/
blocks
/
{id}
Delete a content block
curl --request DELETE \
--url https://app.sajn.se/api/v1/blocks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.sajn.se/api/v1/blocks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.sajn.se/api/v1/blocks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.sajn.se/api/v1/blocks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.sajn.se/api/v1/blocks/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.sajn.se/api/v1/blocks/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.sajn.se/api/v1/blocks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cm4k2x9p10028abcd1234efgh",
"deleted": true
}{
"code": "INVALID_API_VERSION",
"message": "Unknown API version \"2026-13\". Supported versions: 2026-09, 2026-10.",
"userMessage": "API-versionen finns inte.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "UNAUTHORIZED",
"message": "Invalid API token",
"userMessage": "Ogiltig API-nyckel",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "INSUFFICIENT_SCOPE",
"message": "Insufficient OAuth scope: requires documents:write",
"userMessage": "Applikationen saknar behörighet (scope) för denna åtgärd.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2",
"requiredScopes": [
"documents:write"
],
"grantedScopes": [
"profile:read"
]
}{
"code": "NOT_FOUND",
"message": "Block not found",
"userMessage": "Resursen hittades inte.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2",
"resource": "block"
}{
"code": "INVALID_STATE",
"message": "The resource's current state doesn't allow the operation, such as editing a document that was already sent or downloading a file that isn't produced yet.",
"userMessage": "Åtgärden är inte möjlig i resursens nuvarande status.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "RATE_LIMITED",
"message": "API rate limit exceeded",
"userMessage": "För många förfrågningar. Försök igen om en stund.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "INTERNAL_ERROR",
"message": "Internal server error",
"userMessage": "Något gick fel.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}{
"code": "UPSTREAM_UNAVAILABLE",
"message": "A service the operation depends on, such as an eID provider or a connected integration, failed or is unavailable. Retry with exponential backoff.",
"userMessage": "En extern tjänst svarar inte just nu. Försök igen om en stund.",
"requestId": "req_V1StGXR8Z5jdHi6BmyT2"
}Authorizations
bearerAuthoauth2
Personal API key, e.g. Authorization: Bearer sajn_sk_.... Not scope-limited — acts as the issuing user.
Headers
API version for this request. Without it, the request uses the organization's default version; an organization without a default is pinned to the latest version by its first request.
Available options:
2026-09, 2026-10 Makes retries safe. A retry with the same key and the same request replays the stored response for 24 hours (header Idempotent-Replayed: true); the same key with a different request returns 400.
Maximum string length:
255Path Parameters
The block ID.
Was this page helpful?
⌘I

