pasteblox

Scripts endpoints

Create, read, update, version, star and fork scripts.

Every public endpoint, with what it takes, what it returns and a curl you can paste. The basics (keys, rate limits, errors, paging) are on REST API. All examples assume your key is in $PASTEBLOX_TOKEN.

All endpoints

EndpointDoesAuth
GET/api/v1/meWho you areKey
GET/api/v1/me/scriptsYour scriptsKey
POST/api/v1/scriptsCreate a scriptKey or none
GET/api/v1/scripts/:slugOne scriptNone
PATCH/api/v1/scripts/:slugEdit detailsOwner
DELETE/api/v1/scripts/:slugDeleteOwner
POST/api/v1/scripts/:slug/restoreUndo a deleteOwner key
POST/api/v1/scripts/:slug/versionsPush a versionOwner
GET/api/v1/scripts/:slug/versionsVersion historyNone
GET/api/v1/scripts/:slug/versions/:nOne version + codeNone
PATCH/api/v1/scripts/:slug/versions/:nEdit summary / changelogOwner
GET/api/v1/scripts/:slug/versions/:n/rawThe code as textNone
PUT/api/v1/scripts/:slug/starStar (DELETE unstars)Key
POST/api/v1/scripts/:slug/forkCopy into your accountKey
POST/api/v1/scripts/:slug/reportsReportKey or none
POST/api/v1/claimAdopt anonymous scriptsKey

"None" means it works without a key, for public and unlisted scripts. "Owner" means your key, or the script's x-claim-token if it was created anonymously. Wherever a path has :n, 3 and v3 both work.

Your account

Who am I

GET/api/v1/me
Auth
API key (or a bearer token)
Success
200

The account behind the key, and which key it is. Handy to check a key works. It's what pbx whoami calls.

Requestsh
curl https://pasteblox.com/api/v1/me \
  -H "x-api-key: $PASTEBLOX_TOKEN"
Response · 200json
{
  "user": { "handle": "you", "name": "You", "image": null, "role": "user" },
  "auth": { "method": "api_key", "keyId": "utl7S1TH6DlpzKlqkQjw1YNtCy8y2e9d", "keyName": "github actions" }
}
  • 401 unauthorizedNo key, or the key is invalid, expired or revoked.

List your scripts

GET/api/v1/me/scripts
Auth
API key
Success
200

Everything you own, every visibility, newest change first. Deleted scripts aren't listed. This is pbx ls.

Query

qstring
Search: part of a title, an exact slug, or a tag (up to 100 characters).
visibilityenum
public, unlisted or private. Leave out for all.
sortenum
updated (default), created, stars, views or fetches.
limit1–100
Page size, default 24.
cursorstring
From the last page's nextCursor.
Requestsh
curl "https://pasteblox.com/api/v1/me/scripts?sort=created&limit=2" \
  -H "x-api-key: $PASTEBLOX_TOKEN"
Response · 200json
{
  "items": [
    {
      "slug": "k3m9x2p7qa",
      "title": "door",
      "visibility": "unlisted",
      "latestVersion": 2,
      "starCount": 0,
      "viewCount": 0,
      "fetchCount": 0,
      "riskStatus": "clean",
      "keySystem": false,
      …
    },
    …
  ],
  "nextCursor": "SLgTdr2gACD4pSg54BNYfVFaDr9qHnSBjjAq-W_R7g"
}

Items are script summaries. Two fields only show up here, for you: riskStatus (pending, clean or flagged: flagged scripts can't be public, and public ones only appear on Explore once clean) and keySystem.

Scripts

Create a script

POST/api/v1/scripts
Auth
API key, or none for an anonymous unlisted script
Rate limit
60 / hour per account (10 / hour per IP when anonymous)
Success
201

Body

contentstringRequired
The code. Up to 512 KB, not empty.
titlestring
Up to 100 characters. Left out, pasteblox picks one from the code.
descriptionstring
Up to 2,000 characters.
languageenum
luau (default) or lua.
visibilityenum
unlisted (default), public or private. Anonymous: unlisted only.
gamestring | null
The Roblox game it's for, up to 64 characters.
tagsstring[]
Up to 8, each 1–24 of a-z 0-9 -.
messagestring
Summary of version 1, up to 200 characters.
notesstring
Changelog of version 1, up to 4,000 characters.
folderIdinteger | null
File it in one of your dashboard folders. Signed in only; the folder must be yours (otherwise 404 folder not found). It's private, so it's never sent back.
namestring | null
A custom URL under your handle: "main.lua" serves the script at /raw/you/main.lua. Signed in only. Lowercased for you; up to 4 parts split by /, see Names.
Requestsh
curl -X POST https://pasteblox.com/api/v1/scripts \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"title":"door","content":"-- door\nprint(\"open\")\n","message":"first cut"}'
Response · 201json
{
  "script": {
    "slug": "k3m9x2p7qa",
    "name": null,
    "title": "door",
    "description": "",
    "visibility": "unlisted",
    "language": "luau",
    "game": null,
    "tags": [],
    "latestVersion": 1,
    "lineCount": 3,
    "sizeBytes": 22,
    "starCount": 0,
    "forkCount": 0,
    "viewCount": 0,
    "fetchCount": 0,
    "flags": [],
    "owner": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:04.902Z",
    "updatedAt": "2026-10-20T15:11:04.902Z",
    "publishedAt": null,
    "hostedFor": null,
    "forkedFrom": null,
    "viewer": { "canEdit": true, "starred": false },
    "urls": {
      "page": "https://pasteblox.com/s/k3m9x2p7qa",
      "raw": "https://pasteblox.com/raw/k3m9x2p7qa",
      "rawPinned": "https://pasteblox.com/raw/k3m9x2p7qa@1",
      "loadstring": "loadstring(game:HttpGet(\"https://pasteblox.com/raw/k3m9x2p7qa\"))()"
    }
  },
  "version": {
    "n": 1,
    "message": "first cut",
    "notes": "",
    "sizeBytes": 22,
    "lineCount": 3,
    "sha256": "dc8d19a0c35a86a8a9fadb6b763896ef4a25ab160ea8bc1a08498a90790e73a4",
    "flags": [],
    "source": "api",
    "author": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:04.902Z"
  }
}

Without a key, the response also has "claimToken". It's returned this once: keep it, it's the only way to edit that script until you claim it.

  • 403 forbiddenAnonymous with a visibility other than unlisted, a folderId or a name.
  • 404 not_foundfolderId isn't one of your folders.
  • 409 conflictAnother live script of yours already has that name.
  • 413 payload_too_largeContent over 512 KB.
  • 422 validation_failedE.g. empty content, a title over 100 characters, a bad tag.

Get a script

GET/api/v1/scripts/:slug
Auth
None for public and unlisted; the owner for private
Success
200

The script's details and its recent versions (without code; get that from one version).

Query

versions0–100
How many recent versions to include, newest first. Default 20.
Requestsh
curl "https://pasteblox.com/api/v1/scripts/k3m9x2p7qa?versions=1"
Response · 200json
{
  "script": {
    "slug": "k3m9x2p7qa",
    "name": null,
    "title": "door",
    "description": "",
    "visibility": "unlisted",
    "language": "luau",
    "game": null,
    "tags": [],
    "latestVersion": 1,
    "lineCount": 3,
    "sizeBytes": 22,
    "starCount": 0,
    "forkCount": 0,
    "viewCount": 0,
    "fetchCount": 0,
    "flags": [],
    "owner": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:04.902Z",
    "updatedAt": "2026-10-20T15:11:04.902Z",
    "publishedAt": null,
    "hostedFor": null,
    "forkedFrom": null,
    "viewer": { "canEdit": true, "starred": false },
    "urls": {
      "page": "https://pasteblox.com/s/k3m9x2p7qa",
      "raw": "https://pasteblox.com/raw/k3m9x2p7qa",
      "rawPinned": "https://pasteblox.com/raw/k3m9x2p7qa@1",
      "loadstring": "loadstring(game:HttpGet(\"https://pasteblox.com/raw/k3m9x2p7qa\"))()"
    }
  },
  "versions": [{
    "n": 1,
    "message": "first cut",
    "notes": "",
    "sizeBytes": 22,
    "lineCount": 3,
    "sha256": "dc8d19a0c35a86a8a9fadb6b763896ef4a25ab160ea8bc1a08498a90790e73a4",
    "flags": [],
    "source": "api",
    "author": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:04.902Z"
  }]
}

viewer is about you: canEdit is true for the owner, starred is null without a key. fetchCount (how often the raw link ran) is only filled in for the owner.

  • 404 not_foundNo such slug, private and not yours, or deleted.
  • 410 goneRemoved by a moderator.

Edit a script

PATCH/api/v1/scripts/:slug
Auth
Owner (key or claim token)
Rate limit
60, then 1 / second per account
Success
200

Change any details; send only the fields you're changing (at least one). To change the code, push a version.

Body

titlestring
Up to 100 characters.
descriptionstring
Up to 2,000 characters.
visibilityenum
public, unlisted or private. A claim token can only keep it unlisted.
languageenum
luau or lua.
gamestring | null
null clears it.
tagsstring[]
Replaces all tags. Lowercased for you.
folderIdinteger | null
Move it into one of your folders; null takes it out. Owner key only, not a claim token.
namestring | null
Set or change its custom URL; null clears it. The old name keeps serving this script. Owner key only, not a claim token.
Requestsh
curl -X PATCH https://pasteblox.com/api/v1/scripts/k3m9x2p7qa \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"title":"door v2","tags":["doors","Utility"],"game":"Doors"}'
Response · 200json
{
  "script": {
    "slug": "k3m9x2p7qa",
    "title": "door v2",
    "tags": ["doors", "utility"],
    "game": "Doors",
    "visibility": "unlisted",
    …
  }
}
  • 403 forbiddenNot yours; or a claim token trying to change visibility, folderId or name.
  • 404 not_foundNo such script, or folderId isn't one of your folders.
  • 409 conflictMaking a script public that the risk scan flagged, or a name another live script of yours has.
  • 422 validation_failedAn empty body ("nothing to update") or a bad field.

Names (custom URLs)

name gives a script a second raw link under its owner's handle. Once it's set, urls.raw and urls.loadstring use it; /raw/k3m9x2p7qa keeps working either way.

Requestsh
curl -X PATCH https://pasteblox.com/api/v1/scripts/k3m9x2p7qa \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"name":"doors/Main.lua"}'
Response · 200json
{
  "script": {
    "slug": "k3m9x2p7qa",
    "name": "doors/main.lua",
    …
    "urls": {
      "page": "https://pasteblox.com/s/k3m9x2p7qa",
      "raw": "https://pasteblox.com/raw/you/doors/main.lua",
      "rawPinned": "https://pasteblox.com/raw/k3m9x2p7qa@2",
      "loadstring": "loadstring(game:HttpGet(\"https://pasteblox.com/raw/you/doors/main.lua\"))()"
    }
  }
}
RuleDetails
Formata–z, 0–9, . _ -; up to 4 parts split by /, each 1–64 characters starting and ending with a letter or digit; 100 characters in total; no ..; not a bare version like 2 or v2. Sent in any case, stored lowercase.
UniquePer owner. Another live script's current name is a 409 conflict.
RenamesThe old name keeps serving this script, so loaders don't break. So does a name you clear.
Moving a nameAn old name of another of your scripts (or a deleted script's name) moves to this one, along with everyone who loads it.
Pinnedurls.rawPinned stays on the slug: /raw/k3m9x2p7qa@n never changes, while /raw/you/doors/main.lua@n follows the name wherever it goes.

Delete a script

DELETE/api/v1/scripts/:slug
Auth
Owner (key or claim token)
Rate limit
60, then 1 / second per account
Success
200

The raw link stops working right away. The script is kept for 30 days, until purgeAfter, and you can restore it until then. After that it's gone for good.

Requestsh
curl -X DELETE https://pasteblox.com/api/v1/scripts/k3m9x2p7qa \
  -H "x-api-key: $PASTEBLOX_TOKEN"
Response · 200json
{ "ok": true, "purgeAfter": "2026-11-19T15:11:37.397Z" }
  • 403 forbiddenNot yours.

Restore a deleted script

POST/api/v1/scripts/:slug/restore
Auth
The owner's API key (not a claim token)
Success
200

Undoes a delete within the 30 days. Same slug, same raw link. This is pbx restore. No body.

Requestsh
curl -X POST https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/restore \
  -H "x-api-key: $PASTEBLOX_TOKEN"
Response · 200json
{ "script": { "slug": "k3m9x2p7qa", "title": "door v2", … } }
  • 404 not_foundNo such script, or not yours.
  • 409 conflictIt isn't deleted.
  • 410 goneThe 30 days have passed.

Versions

Push a version

POST/api/v1/scripts/:slug/versions
Auth
Owner (key or claim token)
Rate limit
20, then 10 / minute per script
Success
201 (new version) · 200 (unchanged)

Uploads new code as the next version. The raw link and every loadstring run it right away. If the code is identical to the newest version, nothing is created: you get 200 with "unchanged": true, and message and notes are ignored.

Body

contentstringRequired
The new code. Up to 512 KB.
messagestring
One-line summary, up to 200 characters.
notesstring
Changelog, up to 4,000 characters. Bullets, ## headings, **bold**, `code`, links; added: / fixed: / changed: / removed: get labels.
baseVersioninteger
The version you started from. If it's not the newest, you get 409 version_conflict instead of overwriting (why).
Requestsh
curl -X POST https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/versions \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"content":"-- door\nprint(\"open\")\nprint(\"close\")\n","message":"close the door too","notes":"- added: close\n- fixed: debounce","baseVersion":1}'
Response · 201json
{
  "unchanged": false,
  "version": {
    "n": 2,
    "message": "close the door too",
    "notes": "- added: close\n- fixed: debounce",
    "sizeBytes": 37,
    "lineCount": 4,
    "sha256": "276f94a3b6a79bfe762b0a2d861721df1d60a00a8d92e22c820e4e216adfff69",
    "flags": [],
    "source": "api",
    "author": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:12.958Z"
  },
  "urls": {
      "page": "https://pasteblox.com/s/k3m9x2p7qa",
      "raw": "https://pasteblox.com/raw/k3m9x2p7qa",
      "rawPinned": "https://pasteblox.com/raw/k3m9x2p7qa@2",
      "loadstring": "loadstring(game:HttpGet(\"https://pasteblox.com/raw/k3m9x2p7qa\"))()"
    }
}
  • 403 forbiddenNot yours (or the wrong claim token).
  • 409 version_conflictbaseVersion isn't the newest. The body has latestVersion.
  • 413 payload_too_largeOver 512 KB.

Version history

GET/api/v1/scripts/:slug/versions
Auth
None for public and unlisted; the owner for private
Success
200

Every version's details (no code), newest first, paged.

Query

limit1–100
Page size, default 24.
cursorstring
From the last page's nextCursor.
Requestsh
curl "https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/versions?limit=1"
Response · 200json
{
  "items": [{
    "n": 2,
    "message": "close the door too",
    "notes": "- added: close\n- fixed: debounce",
    "sizeBytes": 37,
    "lineCount": 4,
    "sha256": "276f94a3b6a79bfe762b0a2d861721df1d60a00a8d92e22c820e4e216adfff69",
    "flags": [],
    "source": "api",
    "author": { "handle": "you", "name": "You", "image": null },
    "createdAt": "2026-10-20T15:11:12.958Z"
  }],
  "nextCursor": "SLgTdr2gACD4pSg54BNYfVFaDr9qHnSBjjAq-W_R7g"
}
  • 404 not_foundNo such script, or private and not yours.

Get one version, with its code

GET/api/v1/scripts/:slug/versions/:n
Auth
None for public and unlisted; the owner for private and key-protected
Success
200

:n is a number or latest. Same fields as above, plus content.

Requestsh
curl https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/versions/latest
Response · 200json
{
  "version": {
    "n": 2,
    "message": "close the door too",
    …
    "content": "-- door\nprint(\"open\")\nprint(\"close\")\n"
  }
}
  • 404 not_found"version 9 does not exist (latest is 2)", or the script isn't visible to you.
  • 410 goneRemoved by a moderator.

Edit a version's summary or changelog

PATCH/api/v1/scripts/:slug/versions/:n
Auth
Owner (key or claim token)
Rate limit
60, then 1 / second per script
Success
200

Fixes the words, never the code. Send message, notes or both; "notes": "" clears the changelog. This is pbx note.

Requestsh
curl -X PATCH https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/versions/2 \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"message":"close the door, too"}'
Response · 200json
{ "version": { "n": 2, "message": "close the door, too", … } }
  • 422 validation_failedAn empty body, or a message over 200 characters.

Get the code as plain text

GET/api/v1/scripts/:slug/versions/:n/raw
Auth
None for public and unlisted; the owner for private and key-protected
Rate limit
300, then 5 / second per IP
Success
200 text/plain

Just the code, never cached. With a key, owners can download their private scripts this way. It's the API twin of the public /raw/k3m9x2p7qa link loadstrings use, except its errors are JSON instead of Lua.

Requestsh
curl -i https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/versions/1/raw
Response · 200json
HTTP/1.1 200 OK
content-type: text/plain; charset=utf-8
content-disposition: inline; filename="k3m9x2p7qa.luau"
etag: "dc8d19a0c35a86a8a9fadb6b763896ef4a25ab160ea8bc1a08498a90790e73a4"
x-pasteblox-version: 1

-- door
print("open")

The etag is the code's SHA-256 and x-pasteblox-version the version number, handy with latest.

Stars, forks and reports

Star or unstar

PUT/api/v1/scripts/:slug/star
Auth
API key
Rate limit
60, then 1 / second per account
Success
200

PUT stars, DELETE on the same path unstars. Both are safe to repeat. No body.

Requestsh
curl -X PUT https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/star \
  -H "x-api-key: $PASTEBLOX_TOKEN"
Response · 200json
{ "starred": true, "starCount": 1 }

Fork a script

POST/api/v1/scripts/:slug/fork
Auth
API key
Rate limit
Counts as a create: 60 / hour per account
Success
201

Copies one version into a new script on your account. The new script's forkedFrom points back at the original.

Body (all optional)

versioninteger
Which version to copy. Default: the newest.
titlestring
Default: the original's title plus “(fork)”.
visibilityenum
unlisted (default), public or private.
Requestsh
curl -X POST https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/fork \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"version":1,"title":"door fork"}'
Response · 201json
{
  "script": {
    "slug": "8d7nxf6q5t",
    "title": "door fork",
    "forkedFrom": { "slug": "k3m9x2p7qa", "version": 1 },
    …
  },
  "version": { "n": 1, "message": "forked from k3m9x2p7qa@1", … }
}
  • 403 forbiddenThe script is key protected (and not yours).
  • 404 not_foundNo such script or version.

Report a script

POST/api/v1/scripts/:slug/reports
Auth
API key or none
Rate limit
5 / hour per account (or IP)
Success
202

Flags a script for the moderators. Always answers 202, even if you (or someone else) reported it already.

Body

reasonenumRequired
malware, credential_theft, webhook_logger, spam, copyright, harassment, illegal or other.
detailsstring
What's wrong, up to 2,000 characters.
versioninteger
Which version, if it's only one.
Requestsh
curl -X POST https://pasteblox.com/api/v1/scripts/k3m9x2p7qa/reports \
  -H "content-type: application/json" \
  -d '{"reason":"webhook_logger","details":"line 12 posts your cookie to a webhook"}'
Response · 202json
{ "ok": true }

Anonymous scripts

Claim anonymous scripts

POST/api/v1/claim
Auth
API key
Rate limit
10, then 10 / minute per account
Success
200

Moves scripts you created without a key into your account, using the claimToken each one came with. Up to 100 at a time. pbx login does this for you.

Body

items{ slug, token }[]Required
1 to 100 pairs of a slug and its claim token.
Requestsh
curl -X POST https://pasteblox.com/api/v1/claim \
  -H "x-api-key: $PASTEBLOX_TOKEN" \
  -H "content-type: application/json" \
  -d '{"items":[{"slug":"5u76k2bmqh","token":"<claim token>"}]}'
Response · 200json
{ "claimed": ["5u76k2bmqh"], "failed": ["22222abcde"] }

failed lists the ones that didn't work, without saying why (wrong token, already claimed or gone), on purpose.

Objects

The shapes that come back, field by field. Anything marked "Owner" is only filled in for the script's owner.

Script

slugstring
10 characters, never changes.
namestring | null
Its custom URL under the owner's handle, like main.lua; null when it has none.
title, descriptionstring
visibilityenum
public, unlisted or private.
languageenum
luau or lua.
gamestring | null
tagsstring[]
latestVersioninteger
The newest version number.
lineCount, sizeBytesinteger
Of the newest version.
starCount, forkCount, viewCountinteger
fetchCountinteger
How often the raw link ran. Owner; 0 for everyone else.
flagsstring[]
Risk-scan hints on the newest version (see Flags).
owneruser | null
{ handle, name, image }; null for anonymous scripts.
createdAt, updatedAtdatetime
publishedAtdatetime | null
First time it went public.
hostedForobject | null
Set when the script is hosted for a partner site.
riskStatusenum
pending, clean or flagged. Owner, /me/scripts only.
keySystemboolean
Behind a key system, so the code is owner-only.
forkedFrom{ slug, version } | null
Details only.
viewer{ canEdit, starred }
About you. Details only.
urlsobject
page, raw (always newest; the named link when the script has a name), rawPinned (this version, by slug) and loadstring (uses raw). Details only.

Version

ninteger
1, 2, 3…
messagestring
One-line summary, "" when none.
notesstring
Changelog, "" when none.
sizeBytes, lineCountinteger
sha256string
Of the code, 64 hex characters.
flagsflag[]
{ code, severity, line?, count, hosts? }
sourceenum
Where it was pushed from: web, cli or api.
authoruser | null
createdAtdatetime
contentstring
The code. Only from GET …/versions/:n.

Flags

Every push is scanned for risky patterns. Flags never block a push; they're hints shown on the script page. severity is info, warn or high.

CodeMeans
discord_webhookContains a Discord webhook URL.
roblosecurityTouches the .ROBLOSECURITY cookie.
ip_loggerLinks a known IP logger.
http_exfilSends HTTP requests to a non-Roblox host (hosts lists them).
remote_loaderloadstring(game:HttpGet(…)). Info only.
env_tamperMixes getfenv/setfenv with loadstring.
escape_runA long run of escape sequences (reads as obfuscated).
blob_lineA huge single-line blob.
obfuscator_signatureA known obfuscator's header.

Errors that every endpoint can return (401, 404, 429, 500…) are on REST API → Errors.

Response · 404json
{ "error": { "code": "not_found", "message": "script not found" } }