> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hawkings.education/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a submission

## Body

<ParamField body="assignment_id" type="string" required />

<ParamField body="student_id" type="string" required />

<ParamField body="content" type="SubmissionContent">
  {`{ text?, audio_url?, code? }`}
</ParamField>

<ParamField body="files" type="File[]">
  Up to 10 files. Pass as multipart upload or pre-uploaded `file_id`s.
</ParamField>

## Examples

<CodeGroup>
  ```ts TypeScript theme={null}
  await hk.submissions.create({
    assignment_id: "asg_123",
    student_id: "usr_42",
    content: { text: "Lorentz invariance means..." },
  });
  ```

  ```php PHP theme={null}
  $hk->submissions->create([
      'assignment_id' => 'asg_123',
      'student_id' => 'usr_42',
      'content' => ['text' => 'Lorentz invariance means...'],
  ]);
  ```
</CodeGroup>

With a file:

<CodeGroup>
  ```ts TypeScript theme={null}
  await hk.submissions.create({
    assignment_id: "asg_123",
    student_id: "usr_42",
    content: { text: "" },
    files: [{ name: "essay.pdf", body: blob, content_type: "application/pdf" }],
  });
  ```

  ```php PHP theme={null}
  $hk->submissions->create([
      'assignment_id' => 'asg_123',
      'student_id' => 'usr_42',
      'content' => ['text' => ''],
      'files' => [[
          'name' => 'essay.pdf',
          'body' => fopen('/path/to/essay.pdf', 'r'),
          'content_type' => 'application/pdf',
      ]],
  ]);
  ```
</CodeGroup>

## Returns

A [Submission](/api-reference/submissions/object) in `ai_status: "pending"`.
