{"openapi":"3.1.0","info":{"title":"GridBank Partner API","version":"1.0.0","description":"Read and download the videos your GridBank account has licensed, from your own\ntools.\n\n## Authentication\n\nEvery request carries an API key as a bearer token:\n\n```\nAuthorization: Bearer apik_<id>.<secret>\n```\n\nCreate a key at https://gridbank.io/account/api-keys. The secret is shown once.\nEvery member holds their own keys, including on a team account.\n\n## What you can see\n\nThe videos your account has licensed, plus those licensed by your team owner.\nA video you have not licensed returns `403`, even though it exists on GridBank.\n\n## Paging\n\n`GET /partner/v1/content` returns `next_cursor`. Pass it back as `cursor` for\nthe next page. No `next_cursor` means there are no more results.\n\n## Rate limits\n\n300 requests per minute per account. Over that, requests are rejected with\n`429` and a `Retry-After` header - wait that many seconds and retry. The limit\nfollows the account, not the key: a member may hold up to 10 keys, and they all\ndraw on the same 300/min. To replace a key without downtime, create the new one,\ndeploy it, then revoke the old one.\n\n## Downloads\n\n`GET /partner/v1/videos/{video_key}/download` returns a URL valid for five\nminutes. Fetch it straight away rather than storing it; request a new one\nwhenever you need it, as often as you like."},"servers":[{"url":"https://api2.gridbank.io","description":"Production"},{"url":"https://staging-api.gridbank.io","description":"Staging"}],"paths":{"/partner/v1/content":{"get":{"tags":["partner"],"summary":"List licensed content","description":"List the videos your account has licensed, newest purchase first. On a team account this includes videos licensed by the team owner. Pass `next_cursor` from the previous response as `cursor` to page through results.","operationId":"get_list_content","security":[{"BearerAuth":[]}],"parameters":[{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Results per page","default":50,"title":"Per Page"},"description":"Results per page"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor from the previous response","title":"Cursor"},"description":"Cursor from the previous response"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicensedContentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"The API key is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}}}}},"/partner/v1/videos/{video_key}/download":{"get":{"tags":["partner"],"summary":"Get a download URL","description":"Issue a time-limited download URL for a video your account has licensed. Returns 403 when the video is not licensed.","operationId":"get_download_video","security":[{"BearerAuth":[]}],"parameters":[{"name":"video_key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":50,"description":"Video key","title":"Video Key"},"description":"Video key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerDownloadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"The API key is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LicensedContentItem":{"properties":{"video_key":{"type":"string","title":"Video Key"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"purchased_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Purchased At","description":"Unix timestamp of the licence purchase"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url","description":"Watermarked preview video URL"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url","description":"Watermarked thumbnail image URL"},"creator":{"$ref":"#/components/schemas/PartnerCreatorResponse"}},"type":"object","required":["video_key","creator"],"title":"LicensedContentItem","description":"One video the caller has licensed.\n\nDeliberately narrower than PurchasedContentResponse: this is the published\nlicensed-content contract, so it carries what API clients need and none of\nthe website's internals."},"LicensedContentResponse":{"properties":{"videos":{"items":{"$ref":"#/components/schemas/LicensedContentItem"},"type":"array","title":"Videos"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Opaque cursor for the next page. Absent when there are no more results."}},"type":"object","required":["videos"],"title":"LicensedContentResponse","description":"A page of the caller's licensed content, newest purchase first."},"PartnerCreatorResponse":{"properties":{"id":{"type":"string","title":"Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id"],"title":"PartnerCreatorResponse","description":"Creator attribution for a licensed video."},"PartnerDownloadResponse":{"properties":{"video_key":{"type":"string","title":"Video Key"},"url":{"type":"string","title":"Url"},"expires_at":{"type":"integer","title":"Expires At","description":"Unix timestamp at which the URL stops working"}},"type":"object","required":["video_key","url","expires_at"],"title":"PartnerDownloadResponse","description":"A time-limited download URL for a licensed video."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"UnauthorizedError":{"type":"object","properties":{"detail":{"type":"object"}},"title":"UnauthorizedError","description":"The API key is missing, malformed, revoked, or not bound to a member."}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key from https://gridbank.io/account/api-keys, as apik_<id>.<secret>"}}}}