The Grain API can create recordings from media captured outside Grain, such as calls from a phone system, recordings from another meeting tool, or transcripts from a different notetaker. Each upload becomes a regular Grain recording that your team can search and share, and you can generate AI notes and action items for it with one click. Use this article to understand the upload flow; the Uploads reference on developers.grain.com has the full technical detail.
Before you start
You need three things to send an upload:
An API token: a Personal Access Token uploads as you. A Workspace Access Token uploads on behalf of anyone in the workspace. See Grain API for where to generate each one and which plans include API access.
The version header: every request must include
Public-Api-Version: 2026-10-01.Media in a supported format: Grain rejects files that don't meet the requirements below, so prepare them first.
Note: Uploads made with a Workspace Access Token must include recorder_ids, since there's no individual user to credit by default.
What you can upload
Each upload has a media_type of video, audio, or transcript.
Video must meet all of these requirements:
MP4 container with H.264 video and exactly one video track
An AAC audio track
Resolution of 720p or lower
At least 10 seconds long
4 GiB or smaller
A keyframe at least every 6 seconds
Audio must be an MP3 file, at least 10 seconds long, and 4 GiB or smaller.
Transcript uploads don't include a file. You send the transcript text, timestamps, and speakers directly in the request.
Note: The maximum length depends on your Grain plan, up to 3 hours. When you create an upload, the response includes max_duration_sec and max_upload_bytes so you can check your file before sending it. Learn more at grain.com/pricing.
If your file doesn't match, the Uploads reference includes an ffmpeg command that converts video and audio into the right format.
Upload a video or audio file
Uploading a file takes two requests: one to create the upload, and one to send the file.
Call 'Create Upload' (
POST /_/public-api/v2/uploads/create) withmedia_typeset tovideooraudio. Add any attributes you already know, such astitle,start_datetime, orparticipants.Copy the
media.upload.urlfrom the response. This is a temporary link for your file, and it expires at the time shown inmedia.upload.expires_at.Send the file to that URL with a
PUTrequest, including the headers listed inmedia.upload.headers.Grain processes the file and creates the recording. Once the upload's
statusissuccess, therecording_idfield points to the new recording.
Uploaded recordings show up in your meeting library with a full transcript. AI notes and action items aren't created automatically. See Generate AI notes and action items below to add them.
If you already have a transcript, you can include a transcript object in attributes with a video or audio upload. Grain uses it instead of transcribing the file. The format is the same as in Upload a transcript below.
Note: If the upload URL expires before Grain receives the file, the upload is marked as failed. Create a new upload to get a fresh URL.
Upload a transcript
A transcript upload creates a recording from text alone, which is useful when you only have the transcript from another tool.
Call 'Create Upload' with
media_typeset totranscript.Include a
transcriptobject inattributes, with alanguagecode (for exampleen) and a list ofsegments. Each segment has aspeaker_key, astartandendtime in milliseconds, and the spokentext.Add a
participantslist and give each person the samespeaker_keyused in their segments. This tells Grain who said what.
There's no file to send, so the upload skips processing. It goes straight to staged, then becomes a recording. If you want to check or correct details first, you can turn off auto-promotion. See Review or edit attributes in the Uploads reference.
Note: If a segment uses a speaker_key that doesn't match any participant, Grain still accepts it and labels that speaker as "Unknown Speaker".
Generate AI notes and action items
Grain doesn't create AI notes or action items automatically for recordings uploaded through the API. This applies to video, audio, and transcript uploads. You can generate them from the recording page.
Open the uploaded recording in Grain.
Go to the 'Summary' tab.
Click 'Run Intelligence'.
Note: Recordings uploaded in the app through '+ New' > 'File upload' get AI notes and action items automatically. Only API uploads need this step.
Choose the team and recorder
Two attributes control who an uploaded recording belongs to:
team_id: attaches the recording to a team. Find team IDs with 'List Teams' (POST /_/public-api/v2/teams).recorder_ids: credits one or more people as the recorder. Find user IDs with 'List Users' (POST /_/public-api/v2/users).
With a Personal Access Token, you're always credited as a recorder, and recorder_ids adds more people. With a Workspace Access Token, recorder_ids is required.
You can also set start_datetime to the time the meeting actually happened, so the recording sorts correctly in your library. It can't be a future date.
FAQ
Can I generate AI notes for uploaded recordings through the API? No. AI notes and action items can only be generated from the recording page in Grain. Open each uploaded recording, go to the 'Summary' tab, and click 'Run Intelligence'.
Why did my upload fail? Check the failure.reason field on the upload. The most common causes are a file that doesn't meet the format requirements, an upload URL that expired before the file arrived, or a staged upload that wasn't promoted before its media expired.
Can I upload .mov, .wav, or .m4a files through the API? Not directly. The API accepts MP4 video and MP3 audio only. Convert other formats first using the ffmpeg commands in the Uploads reference.
Is there a minimum length? Yes. Video and audio uploads must be at least 10 seconds long.
Can I change an upload's details after it becomes a recording? You can change the title and tags with the recording endpoints. To edit participants or the transcript before the recording is created, create the upload with auto_promote set to false and update it while it's staged.
What happens to uploads that never finish? Grain periodically deletes uploads that never reached success. Create a new upload if you need to try again.
Is there a limit on how many recordings I can upload through the API? Workspace Access Token uploads and transcript uploads aren't limited. Video and audio uploads made with a Personal Access Token use your plan's upload allowance. The maximum length of a video or audio upload depends on your plan, up to 3 hours.


