Skip to main content
POST
/
files
/
v3
/
files
Subir archivo
curl --request POST \
  --url https://api.hubapi.com/files/v3/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'folderId=<string>' \
  --form 'folderPath=<string>' \
  --form 'fileName=<string>' \
  --form 'charsetHunch=<string>' \
  --form 'options=<string>' \
  --form file=@example-file
{
  "extension": "<string>",
  "access": "PUBLIC_INDEXABLE",
  "parentFolderId": "<string>",
  "sourceGroup": "<string>",
  "fileMd5": "<string>",
  "encoding": "<string>",
  "type": "<string>",
  "isUsableInContent": true,
  "url": "<string>",
  "expiresAt": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z",
  "path": "<string>",
  "archived": true,
  "size": 123,
  "name": "<string>",
  "width": 123,
  "id": "<string>",
  "defaultHostingUrl": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "height": 123
}
Productos compatibles
Se requiere uno de los siguientes productos o productos de ediciones superiores.
Marketing HubMarketing HubGratuito
Sales HubSales HubGratuito
Service HubService HubGratuito
Content HubContent HubStarter

Ámbitos Requeridos

Esta API requiere uno de los siguientes ámbitos:
  • files

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

multipart/form-data
file
file

File to be uploaded.

folderId
string

Either 'folderId' or 'folderPath' is required. folderId is the ID of the folder the file will be uploaded to.

folderPath
string

Either 'folderPath' or 'folderId' is required. This field represents the destination folder path for the uploaded file. If a path doesn't exist, the system will try to create one.

fileName
string

Desired name for the uploaded file.

charsetHunch
string

Character set of the uploaded file.

options
string

JSON string representing FileUploadOptions.

Response

successful operation

File

access
enum<string>
required

Acceso a archivos. Puede ser PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE.

Available options:
PUBLIC_INDEXABLE,
PUBLIC_NOT_INDEXABLE,
HIDDEN_INDEXABLE,
HIDDEN_NOT_INDEXABLE,
HIDDEN_PRIVATE,
PRIVATE,
HIDDEN_SENSITIVE,
SENSITIVE
createdAt
string<date-time>
required

Hora de creación del objeto de archivo.

archived
boolean
required

Si se elimina el archivo.

id
string
required

ID de archivo.

updatedAt
string<date-time>
required

Marca de tiempo de la última actualización del archivo.

extension
string

Extensión del archivo. Ej: .jpg, .png, .gif, .pdf, etc.

parentFolderId
string

ID de la carpeta en la que se encuentra el archivo.

sourceGroup
string

The group from which the file originated.

fileMd5
string

The MD5 hash of the file.

encoding
string

Codificación del archivo.

type
string

Tipo de archivo. Puede ser IMG, DOCUMENTO, AUDIO, PELÍCULA u OTRO.

isUsableInContent
boolean

Anteriormente "archivado". Indica si el archivo debe usarse al crear nuevo contenido como páginas web.

url
string

URL del archivo dado. Esta URL puede cambiar dependiendo de la configuración del dominio de la cuenta. Se utilizará el dominio de alojamiento de archivos seleccionado.

expiresAt
integer

The timestamp indicating when the file will expire.

archivedAt
string<date-time>

Hora de eliminación del objeto de archivo.

path
string

Ruta del archivo en el administrador de archivos.

size
integer

Tamaño del archivo en bytes.

name
string

Nombre del archivo.

width
integer

Para archivos de imagen y vídeo, el ancho del contenido.

defaultHostingUrl
string

URL de alojamiento predeterminado del archivo. Se utilizará una de las URLs proporcionadas por HubSpot para mostrar el archivo.

height
integer

Para archivos de imagen y vídeo, la altura del contenido.

I