API başvurusu
https://api.perafly.com/v1 açık API'sinin her ucu, OpenAPI belgesinden üretilir: kimlik, parametreler, istek gövdeleri, yanıtlar ve hata kodları.
Perafly API 1.0.0, OpenAPI belgesinden üretilir.
Temeller
Hatalar
Hatalar RFC 9457'ye (application/problem+json) uyar ve kararlı bir code taşır; karar verirken yalnız code'a bak. type, hata kataloğundaki kodun sayfasına bağlanır. Plan sınırları 402 döner ve sınırın adını code'da söyler.
OpenAPI belgesi
Bu başvuru GET https://api.perafly.com/v1/openapi.json adresindeki makine okunur sözleşmeden (OpenAPI 3.1, kimlik gerekmez) üretilir. MCP araçları aynı işlem adlarını taşır.
Uçlar
Uç özetleri OpenAPI belgesinden gelir ve İngilizcedir.
Kimlik ve giriş
Kimliğin kime ait olduğu, CLI'ın cihazla girişi ve devir bağlantıları.
- GET/v1/meIdentity behind the credential: team key (team, role, permissions) or project key (its project)
- POST/v1/auth/deviceStart a device sign-in (RFC 8628); the user approves at verificationUri
- POST/v1/auth/device/tokenExchange an approved device code for a CLI API key (once). 400 authorization_pending | slow_down | access_denied | expired_token
- POST/v1/auth/handoffExchange a one-time handoff link (pfh_…) for an agent key limited to one project
- POST/v1/auth/logoutRevoke the calling API key
API anahtarları
Takımın API anahtarları (pfa_…). Bir kişinin tam profilli girişini ister.
Projeler
Proje açma, okuma, ad değiştirme, silme ve hesapsız yayınlanan projeyi sahiplenme.
- GET/v1/projectsList projects (a project key sees only its project)
- POST/v1/projectsCreate an empty project
- GET/v1/projects/{project}Get a project
- PATCH/v1/projects/{project}Rename, retitle or change the publish rule
- DELETE/v1/projects/{project}Delete a project (confirmName must equal its name)
- GET/v1/lookupWhich project (and version) a Perafly address belongs to: live, version (--vN), branch preview (--br-), custom domain or storage file URL. Only projects this credential can see; anything else is not_found
- POST/v1/projects/{project}/claimMove an ownerless project into the key's team; optionally mint a project-scoped agent key (returned once)
Yayın
Dosyaları bildirme, eksikleri yükleme, sürümü tamamlama ve uzun işlemleri izleme.
- POST/v1/publishDeclare files for a new version; returns upload URLs for missing files. Without credentials a new ownerless project is created and its project key is returned once
- PUT/v1/uploads/{token}Upload one file's bytes to a signed upload URL
- POST/v1/versions/{version}/finalizeFinalize uploads and deploy; waits until ready (up to `wait` seconds)
- GET/v1/operations/{operation}Status of a long-running operation
Sürümler
Sürümleri listeleme, birini canlıya alma (geri alma da), eskileri silme ve derleme logları.
- GET/v1/projects/{project}/versionsList versions (newest first)
- GET/v1/projects/{project}/versions/{version}Get a version
- DELETE/v1/projects/{project}/versions/{version}Delete a version that is not live
- POST/v1/projects/{project}/versions/{version}/promoteMake a ready version live (also used to roll back); no rebuild. With an agent credential: 403 approval_required and an execution to resume after approval
- GET/v1/projects/{project}/versions/{version}/filesList a version's files
- GET/v1/projects/{project}/logs/buildBuild log of a version (latest by default)
Onaylar
Takım arkadaşının onayını bekleyen yürütmeler ve sürdürülmeleri.
Erişim ve paylaşım
Herkese açık ya da özel proje, paylaşım bağlantısı, parola ve kişiler.
- GET/v1/projects/{project}/accessWho can open the project: public or private, share link, password, people and pending access requests
- PUT/v1/projects/{project}/accessMake the project public or private (needs share.manage and a full-access key; agents can't change access)
- POST/v1/projects/{project}/access/linkCreate a share link (the URL is returned once; it replaces the previous link)
- DELETE/v1/projects/{project}/access/linkTurn off the share link
- PUT/v1/projects/{project}/access/passwordSet the visitor password (8–72 characters)
- DELETE/v1/projects/{project}/access/passwordRemove the visitor password
- POST/v1/projects/{project}/access/peopleShare the project with a person by email (they sign in to Perafly with that address)
- DELETE/v1/projects/{project}/access/people/{share}Stop sharing with a person
Özel alan adları
Alan adı bağlama, girilecek DNS kayıtları ve denetim.
- GET/v1/projects/{project}/domainsCustom domains of the project with status and the DNS records to set
- POST/v1/projects/{project}/domainsConnect a custom domain; returns the DNS records to set. Counts toward the plan's domain limit
- DELETE/v1/projects/{project}/domains/{domain}Disconnect a custom domain
- POST/v1/projects/{project}/domains/{domain}/checkCheck verification and DNS now
Veri
Koleksiyonlar, kayıtlar, proje anahtarları ve kanca teslimleri.
- GET/v1/projects/{project}/collectionsCollections of the project's headless data layer with their schema, rules and record counts
- POST/v1/projects/{project}/collectionsCreate a collection: name, fields, access rules and optional change hook. The first collection also creates the publishable key
- GET/v1/projects/{project}/collections/{collection}One collection
- PATCH/v1/projects/{project}/collections/{collection}Change fields (the full list), rules or the change hook. A field's type cannot change; making read, update or delete public needs a person, not an agent
- DELETE/v1/projects/{project}/collections/{collection}Delete a collection and its records
- GET/v1/projects/{project}/collections/{collection}/exportExport every record as CSV or JSON (a file). Not with the publishable key
- GET/v1/projects/{project}/data/{collection}List records. filter[field]=value or filter[field][gte]=… (eq, ne, gt, gte, lt, lte, in) and sort=-createdAt on indexed and system fields. Counts toward the monthly data requests
- POST/v1/projects/{project}/data/{collection}Add a record (the body is the record's fields). With the publishable key only when the collection's create rule is public
- GET/v1/projects/{project}/data/{collection}/{record}One record
- PATCH/v1/projects/{project}/data/{collection}/{record}Change some fields; null removes a field
- DELETE/v1/projects/{project}/data/{collection}/{record}Delete a record
- GET/v1/projects/{project}/data-keysThe project's publishable key and whether a secret key and webhook secret exist (the secret is never shown again)
- POST/v1/projects/{project}/data-keys/publishableReplace the publishable key; the old one stops working at once. Needs keys.manage and a person's key
- POST/v1/projects/{project}/data-keys/secretCreate or replace the secret key; returned once. It becomes the PERAFLY_SECRET_KEY environment variable from the next version. Needs keys.manage and a person's key
- DELETE/v1/projects/{project}/data-keys/secretRevoke the secret key
- GET/v1/projects/{project}/hook-deliveriesThe last 50 change hook deliveries
Ortam değişkenleri
Projenin ortam değişkenleri; değişiklik sonraki sürümde geçerlidir.
Depolama
Yol adresli proje dosyaları: listeleme, yükleme, indirme, taşıma ve silme.
- GET/v1/projects/{project}/storageFiles and folders under a prefix (public/ or private/)
- DELETE/v1/projects/{project}/storageDelete a file (?path=) or a folder (?prefix=, up to 1000 files)
- POST/v1/projects/{project}/storage/uploadsGet a signed upload URL for one file; PUT the bytes there. Checks the plan's storage limits
- GET/v1/projects/{project}/storage/fileA file's details and a signed download URL (15 minutes)
- POST/v1/projects/{project}/storage/moveMove or rename a file, or a folder when from ends with /
- PUT/v1/storage-uploads/{token}The file's bytes (exactly the declared size)
- GET/v1/storage-files/{token}The file itself
SFTP
Proje depolaması için SFTP hesapları.
- GET/v1/projects/{project}/sftpSFTP accounts, the host and port to connect to, and whether the plan includes SFTP
- POST/v1/projects/{project}/sftpOpen an SFTP account with an SSH public key or a generated password (returned once). Paid plans; needs keys.manage and a person's key
- DELETE/v1/projects/{project}/sftp/{account}Revoke an SFTP account
Git
GitHub bağlantısı, derlemeler ve dal önizlemeleri.
- GET/v1/projects/{project}/gitGit connection and settings: GitHub repository, production branch, automatic deploys and the direct push address
- PUT/v1/projects/{project}/gitConnect a GitHub repository (from the team's installations) or change branch settings. Turning on automatic production deploys needs versions.promote
- DELETE/v1/projects/{project}/gitDisconnect the GitHub repository; versions and branch previews stay
- GET/v1/projects/{project}/git/buildsThe last 50 Git builds
- POST/v1/projects/{project}/git/builds/{build}/approveApprove a pull request build from a fork; it gets the project's environment variables
- GET/v1/projects/{project}/branchesBranch preview addresses and the version each one serves
Loglar ve ölçümler
İstek, çalışma ve derleme logları, trafik ve çalışma ölçümleri.
- GET/v1/projects/{project}/logsAccess, runtime and build logs, newest first; pass after=<cursor> to follow new lines (oldest first). Older than the plan's retention is cut (truncated: true)
- GET/v1/projects/{project}/metricsTraffic (requests, page views, visitors, bandwidth, status codes, top paths) and runtime metrics (invocations, duration, CPU, memory). Unmeasured values are null; runsCode false means the project runs no code
- GET/v1/metrics/projectsThe team's projects ranked by requests in the range, with errors, bandwidth, visitors, invocations and build seconds
Yerleşik ajan
Ajan oturumları, olayları, iletiler, bütçe ve araç onayları.
- GET/v1/agent/sessionsBuilt-in agent sessions of the team (full sign-in only)
- POST/v1/agent/sessionsStart the built-in agent: it builds and publishes a preview version. Spends agent credits up to the budget
- GET/v1/agent/sessions/{session}One agent session
- GET/v1/agent/sessions/{session}/eventsConversation and progress of an agent session, oldest first; pass after=<seq> for new events
- POST/v1/agent/sessions/{session}/messagesSend a message to the agent
- POST/v1/agent/sessions/{session}/interruptStop what the agent is doing
- POST/v1/agent/sessions/{session}/budgetChange the session budget; a paused session continues
- POST/v1/agent/sessions/{session}/confirmations/{event}Allow or deny a command the agent is waiting on
Kullanım ve planlar
Dönemin kullanımı ve herkese açık planlar.
OpenAPI ve belge araması
Bu API'nin makine okunur sözleşmesi ve bu belgelerde arama.
Şemalar
Uçların gönderip aldığı nesneler ayrı bir sayfada anlatılır. 41 şemanın hepsini gör