Skip to main content
POST
/
v1
/
objects
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: 'My Bearer Token',
});

const objectView = await client.objects.create({ content_type: 'unspecified', name: 'name' });

console.log(objectView.id);
{
  "id": "<string>",
  "name": "<string>",
  "state": "UPLOADING",
  "size_bytes": 123,
  "content_type": "unspecified",
  "create_time_ms": 123,
  "delete_after_time_ms": 123,
  "upload_url": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters required to create a new Object.

name
string
required

The name of the Object.

content_type
enum<string>
required

The content type of the Object.

Available options:
unspecified,
text,
binary,
gzip,
tar,
tgz
metadata
object | null

User defined metadata to attach to the object for organization.

ttl_ms
integer | null

Optional lifetime of the object in milliseconds, after which the object is automatically deleted. Time starts ticking after the object is created.

Response

Object created successfully. Returns the Object with metadata.

An Object represents a stored data entity with metadata.

id
string
required

The unique identifier of the Object.

name
string
required

The name of the Object.

state
enum<string>
required

The current state of the Object.

Available options:
UPLOADING,
READ_ONLY,
DELETED,
ERROR
content_type
enum<string>
required

The content type of the Object.

Available options:
unspecified,
text,
binary,
gzip,
tar,
tgz
create_time_ms
integer
required

The creation time of the Object in milliseconds since epoch.

size_bytes
integer | null

The size of the Object content in bytes (null until uploaded).

delete_after_time_ms
integer | null

The time after which the Object will be deleted in milliseconds since epoch.

upload_url
string | null

Presigned URL for uploading content to S3 (only present on create).