Options
All
  • Public
  • Public/Protected
  • All
Menu

contentful-management.js - v7.3.0

Index

Enumerations

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

ActionType

ActionType: "read" | "create" | "update" | "delete" | "publish" | "unpublish" | "archive" | "unarchive"

ApiKeyProps

ApiKeyProps: { accessToken: string; description?: undefined | string; environments: { sys: MetaLinkProps }[]; name: string; policies?: { action: string; effect: string }[]; preview_api_key: { sys: MetaLinkProps }; sys: MetaSysProps }

Type declaration

AppDefinitionProps

AppDefinitionProps: { locations?: AppLocation[]; name: string; parameters?: undefined | { instance?: ParameterDefinition[] }; src?: undefined | string; sys: BasicMetaSysProps & { organization: SysLink } }

Type declaration

  • Optional locations?: AppLocation[]

    Locations where the app can be installed

  • name: string

    App name

  • Optional parameters?: undefined | { instance?: ParameterDefinition[] }

    Instance parameter definitions

  • Optional src?: undefined | string

    URL where the root HTML document of the app can be found

  • sys: BasicMetaSysProps & { organization: SysLink }

    System metadata

AppInstallationProps

AppInstallationProps: { parameters?: FreeFormParameters; sys: BasicMetaSysProps & { appDefinition: SysLink; environment: SysLink; space: SysLink } }

Type declaration

AppLocation

AssetApi

AssetApi: { archive: any; delete: any; isArchived: any; isDraft: any; isPublished: any; isUpdated: any; processForAllLocales: any; processForLocale: any; publish: any; unarchive: any; unpublish: any; update: any }

Type declaration

  • archive: function
    • archive(): Promise<Asset>
    • Archives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.archive())
      .then((asset) => console.log(`Asset ${asset.sys.id} archived.`)
      .catch(console.error)

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • delete: function
    • delete(): Promise<void>
    • Deletes this object on the server.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.delete())
      .then((asset) => console.log(`Asset deleted.`)
      .catch(console.error)

      Returns Promise<void>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

  • isArchived: function
    • isArchived(): boolean
    • Checks if asset is archived. This means it's not exposed to the Delivery/Preview APIs.

      Returns boolean

  • isDraft: function
    • isDraft(): boolean
  • isPublished: function
    • isPublished(): boolean
    • Checks if the asset is published. A published asset might have unpublished changes

      Returns boolean

  • isUpdated: function
    • isUpdated(): boolean
    • Checks if the asset is updated. This means the asset was previously published but has unpublished changes.

      Returns boolean

  • processForAllLocales: function
    • Triggers asset processing after an upload, for the files uploaded to all locales of an asset.

      prop

      options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms)

      prop

      options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5)

      throws

      {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.createAssetWithId('<asset_id>', {
        title: {
          'en-US': 'Playsam Streamliner',
          'de-DE': 'Playsam Streamliner'
        },
        file: {
          'en-US': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example.jpg'
          },
          'de-DE': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example-de.jpg'
          }
        }
      }))
      .then((asset) => asset.processForAllLocales())
      .then((asset) => console.log(asset))
      .catch(console.error)

      Parameters

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • processForLocale: function
    • Triggers asset processing after an upload, for the file uploaded to a specific locale.

      prop

      options.processingCheckWait - Time in milliseconds to wait before checking again if the asset has been processed (default: 500ms)

      prop

      options.processingCheckRetries - Maximum amount of times to check if the asset has been processed (default: 5)

      throws

      {AssetProcessingTimeout} If the asset takes too long to process. If this happens, retrieve the asset again, and if the url property is available, then processing has succeeded. If not, your file might be damaged.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.createAssetWithId('<asset_id>', {
        title: {
          'en-US': 'Playsam Streamliner',
        },
        file: {
          'en-US': {
            contentType: 'image/jpeg',
            fileName: 'example.jpeg',
            upload: 'https://example.com/example.jpg'
          }
        }
      }))
      .then((asset) => asset.processForLocale('en-US'))
      .then((asset) => console.log(asset))
      .catch(console.error)

      Parameters

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • publish: function
    • publish(): Promise<Asset>
    • Publishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.publish())
      .then((asset) => console.log(`Asset ${asset.sys.id} published.`)
      .catch(console.error)

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • unarchive: function
    • unarchive(): Promise<Asset>
    • Unarchives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.unarchive())
      .then((asset) => console.log(`Asset ${asset.sys.id} unarchived.`)
      .catch(console.error)

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • unpublish: function
    • unpublish(): Promise<Asset>
    • Unpublishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => asset.unpublish())
      .then((asset) => console.log(`Asset ${asset.sys.id} unpublished.`)
      .catch(console.error)

      Returns Promise<Asset>

      Object returned from the server with updated metadata.

  • update: function
    • update(): Promise<Asset>
    • Sends an update to the server with any changes made to the object's properties

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getAsset('<asset_id>'))
      .then((asset) => {
        asset.fields.title['en-US'] = 'New asset title'
        return asset.update()
      })
      .then((asset) => console.log(`Asset ${asset.sys.id} updated.`)
      .catch(console.error)

      Returns Promise<Asset>

      Object returned from the server with updated changes.

AssetProps

AssetProps: { fields: { description?: undefined | {}; file: {}; title: {} }; metadata?: MetadataProps; sys: EntityMetaSysProps }

Type declaration

  • fields: { description?: undefined | {}; file: {}; title: {} }
    • Optional description?: undefined | {}

      Description for this asset

    • file: {}

      File object for this asset

      • [key: string]: { contentType: string; details?: Record<string, any>; fileName: string; upload?: undefined | string; uploadFrom?: Record<string, any>; url?: undefined | string }
        • contentType: string
        • Optional details?: Record<string, any>

          Details for the file, depending on file type (example: image size in bytes, etc)

        • fileName: string
        • Optional upload?: undefined | string

          Url where the file is available to be downloaded from, into the Contentful asset system. After the asset is processed this field is gone.

        • Optional uploadFrom?: Record<string, any>
        • Optional url?: undefined | string

          Url where the file is available at the Contentful media asset system. This field won't be available until the asset is processed.

    • title: {}

      Title for this asset

      • [key: string]: string
  • Optional metadata?: MetadataProps
  • sys: EntityMetaSysProps

ClientAPI

ClientAPI: ReturnType<typeof createClientApi>

ClientParams

ClientParams: { accessToken: string; application?: undefined | string; feature?: undefined | string; headers?: undefined | {}; host?: undefined | string; hostUpload?: undefined | string; httpAgent?: httpAgent; httpsAgent?: httpsAgent; insecure?: undefined | false | true; integration?: undefined | string; logHandler?: undefined | ((level: string, data: Error | string) => void); maxContentLength?: undefined | number; proxy?: AxiosProxyConfig; requestLogger?: undefined | ((config: AxiosRequestConfig) => void); responseLogger?: undefined | ((response: AxiosResponse) => void); retryLimit?: undefined | number; retryOnError?: undefined | false | true; timeout?: undefined | number }

Type declaration

  • accessToken: string

    Contentful CMA Access Token

  • Optional application?: undefined | string

    Application name and version e.g myApp/version

  • Optional feature?: undefined | string
  • Optional headers?: undefined | {}

    Optional additional headers

  • Optional host?: undefined | string

    API host

    default

    api.contentful.com

  • Optional hostUpload?: undefined | string

    direct file upload host

    default

    upload.contentful.com

  • Optional httpAgent?: httpAgent

    Optional Node.js HTTP agent for proxying

    see

    Node.js docs and https-proxy-agent

  • Optional httpsAgent?: httpsAgent

    Optional Node.js HTTP agent for proxying

    see

    Node.js docs and https-proxy-agent

  • Optional insecure?: undefined | false | true

    Requests will be made over http instead of the default https

    default

    false

  • Optional integration?: undefined | string

    Integration name and version e.g react/version

  • Optional logHandler?: undefined | ((level: string, data: Error | string) => void)

    A log handler function to process given log messages & errors. Receives the log level (error, warning & info) and the actual log data (Error object or string).

    see

    The default can be found at: https://github.com/contentful/contentful-sdk-core/blob/master/lib/create-http-client.js

  • Optional maxContentLength?: undefined | number

    Optional maximum content length in bytes

    default

    1073741824 i.e 1GB

  • Optional proxy?: AxiosProxyConfig

    Optional Axios proxy

    see

    axios docs

  • Optional requestLogger?: undefined | ((config: AxiosRequestConfig) => void)

    Gets called on every request triggered by the SDK

  • Optional responseLogger?: undefined | ((response: AxiosResponse) => void)

    Gets called on every response

  • Optional retryLimit?: undefined | number

    Optional number of retries before failure

    default

    5

  • Optional retryOnError?: undefined | false | true

    If we should retry on errors and 429 rate limit exceptions

    default

    true

  • Optional timeout?: undefined | number

    Optional number of milliseconds before the request times out.

    default

    30000

ConditionType

ConditionType: "and" | "or" | "not" | "equals"

ConstraintType

ConstraintType: {}

Type declaration

ContentTypeApi

ContentTypeApi: { delete: any; getEditorInterface: any; getSnapshot: any; getSnapshots: any; isDraft: any; isPublished: any; isUpdated: any; omitAndDeleteField: any; publish: any; unpublish: any; update: any }

Type declaration

  • delete: function
    • delete(): Promise<void>
    • Deletes this object on the server.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.delete())
      .then(() => console.log('contentType deleted'))
      .catch(console.error)

      Returns Promise<void>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

  • getEditorInterface: function
    • Gets the editor interface for the object
      Important note: The editor interface only represent a published contentType.
      To get the most recent representation of the contentType make sure to publish it first

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.getEditorInterface())
      .then((editorInterface) => console.log(editorInterface.contorls))
      .catch(console.error)

      Returns Promise<EditorInterface>

      Object returned from the server with the current editor interface.

  • getSnapshot: function
    • Gets a snapshot of a contentType

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((entry) => entry.getSnapshot('<snapshot-id>'))
      .then((snapshot) => console.log(snapshot))
      .catch(console.error)

      Parameters

      • snapshotId: string

        Id of the snapshot

      Returns Promise<SnapshotProps<ContentTypeProps>>

  • getSnapshots: function
    • Gets all snapshots of a contentType

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((entry) => entry.getSnapshots())
      .then((snapshots) => console.log(snapshots.items))
      .catch(console.error)

      Returns Promise<Collection<Snapshot<ContentTypeProps>, SnapshotProps<ContentTypeProps>>>

  • isDraft: function
    • isDraft(): boolean
  • isPublished: function
    • isPublished(): boolean
    • Checks if the contentType is published. A published contentType might have unpublished changes (@see {ContentType.isUpdated})

      Returns boolean

  • isUpdated: function
    • isUpdated(): boolean
    • Checks if the contentType is updated. This means the contentType was previously published but has unpublished changes.

      Returns boolean

  • omitAndDeleteField: function
    • Omits and deletes a field if it exists on the contentType. This is a convenience method which does both operations at once and potentially less safe than the standard way. See note about deleting fields on the Update method.

      Parameters

      • id: string

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • publish: function
    • Publishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.publish())
      .then((contentType) => console.log(`${contentType.sys.id} is published`))
      .catch(console.error)

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • unpublish: function
    • Unpublishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => contentType.unpublish())
      .then((contentType) => console.log(`${contentType.sys.id} is unpublished`))
      .catch(console.error)

      Returns Promise<ContentType>

      Object returned from the server with updated metadata.

  • update: function
    • Sends an update to the server with any changes made to the object's properties.
      Important note about deleting fields: The standard way to delete a field is with two updates: first omit the property from your responses (set the field attribute "omitted" to true), and then delete it by setting the attribute "deleted" to true. See the "Deleting fields" section in the API reference for more reasoning. Alternatively, you may use the convenience method omitAndDeleteField to do both steps at once.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getContentType('<contentType_id>'))
      .then((contentType) => {
       contentType.name = 'New name'
       return contentType.update()
      })
      .then(contentType => console.log(contentType))
      .catch(console.error)

      Returns Promise<ContentType>

      Object returned from the server with updated changes.

ContentTypeProps

ContentTypeProps: { description: string; displayField: string; fields: ContentFields[]; name: string; sys: BasicMetaSysProps & { environment: SysLink; firstPublishedAt?: undefined | string; publishedCounter?: undefined | number; publishedVersion?: undefined | number; space: SysLink } }

Type declaration

  • description: string
  • displayField: string

    Field used as the main display field for Entries

  • fields: ContentFields[]

    All the fields contained in this Content Type

  • name: string
  • sys: BasicMetaSysProps & { environment: SysLink; firstPublishedAt?: undefined | string; publishedCounter?: undefined | number; publishedVersion?: undefined | number; space: SysLink }

ContentfulEnvironmentAPI

ContentfulEnvironmentAPI: ReturnType<typeof createEnvironmentApi>

ContentfulOrganizationAPI

ContentfulOrganizationAPI: ReturnType<typeof createOrganizationApi>

ContentfulSpaceAPI

ContentfulSpaceAPI: ReturnType<typeof createSpaceApi>

CreateApiKeyProps

CreateApiKeyProps: Pick<ApiKeyProps, "name" | "environments" | "description">

CreateAppDefinitionProps

CreateAppDefinitionProps: SetOptional<Except<AppDefinitionProps, "sys">, "src" | "locations">

CreateAppInstallationProps

CreateAppInstallationProps: Except<AppInstallationProps, "sys">

CreateAssetProps

CreateAssetProps: Omit<AssetProps, "sys">

CreateContentTypeProps

CreateContentTypeProps: SetOptional<Except<ContentTypeProps, "sys">, "description" | "displayField">

CreateEntryProps

CreateEntryProps<TFields>: Omit<EntryProps<TFields>, "sys">

Type parameters

  • TFields

CreateEnvironmentAliasProps

CreateEnvironmentAliasProps: Omit<EnvironmentAliasProps, "sys">

CreateEnvironmentProps

CreateEnvironmentProps: Partial<Omit<EnvironmentProps, "sys">>

CreateLocaleProps

CreateLocaleProps: SetOptional<Except<LocaleProps, "sys">, "optional" | "contentManagementApi" | "default" | "contentDeliveryApi">

CreateOrganizationInvitationProps

CreateOrganizationInvitationProps: Omit<OrganizationInvitationProps, "sys">

CreatePersonalAccessTokenProps

CreatePersonalAccessTokenProps: Pick<PersonalAccessToken, "name" | "scopes">

CreateRoleProps

CreateRoleProps: Omit<RoleProps, "sys">

CreateSpaceMembershipProps

CreateSpaceMembershipProps: Omit<SpaceMembershipProps, "sys">

CreateTagProps

CreateTagProps: Omit<TagProps, "sys">

CreateTeamMembershipProps

CreateTeamMembershipProps: Omit<TeamMembershipProps, "sys">

CreateTeamProps

CreateTeamProps: Omit<TeamProps, "sys">

CreateTeamSpaceMembershipProps

CreateTeamSpaceMembershipProps: Omit<TeamSpaceMembershipProps, "sys">

CreateUIExtensionProps

CreateUIExtensionProps: RequireExactlyOne<SetRequired<UIExtensionProps["extension"], "name" | "fieldTypes" | "sidebar">, "src" | "srcdoc">

CreateWebhooksProps

CreateWebhooksProps: SetOptional<Except<WebhookProps, "sys">, "headers">

DefaultParams

DefaultParams: { environmentId?: undefined | string; organizationId?: undefined | string; spaceId?: undefined | string }

Type declaration

  • Optional environmentId?: undefined | string
  • Optional organizationId?: undefined | string
  • Optional spaceId?: undefined | string

DefinedParameters

DefinedParameters: Record<string, string | number | boolean>

EditorInterfaceProps

EditorInterfaceProps: { controls?: Control[]; editor?: Editor; editors?: Editor[]; sidebar?: SidebarItem[]; sys: MetaSysProps & { contentType: { sys: MetaLinkProps }; environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } } }

Type declaration

  • Optional controls?: Control[]

    Array of fields and it's associated widgetId

  • Optional editor?: Editor

    Legacy singular editor override

  • Optional editors?: Editor[]

    Array of editors. Defaults will be used if property is missing.

  • Optional sidebar?: SidebarItem[]

    Array of sidebar widgerts. Defaults will be used if property is missing.

  • sys: MetaSysProps & { contentType: { sys: MetaLinkProps }; environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } }

EndpointDefinition

EndpointDefinition<T, P, R>: (http: AxiosInstance, params: P, ...rest: T) => R

Type parameters

  • T: any[]

  • P: {}

  • R

Type declaration

    • (http: AxiosInstance, params: P, ...rest: T): R
    • Parameters

      • http: AxiosInstance
      • params: P
      • Rest ...rest: T

      Returns R

EndpointWithHttp

EndpointWithHttp<R>: (http: AxiosInstance) => R

Type parameters

  • R

Type declaration

    • (http: AxiosInstance): R
    • Parameters

      • http: AxiosInstance

      Returns R

EntryApi

EntryApi: { archive: any; delete: any; getSnapshot: any; getSnapshots: any; isArchived: any; isDraft: any; isPublished: any; isUpdated: any; publish: any; unarchive: any; unpublish: any; update: any }

Type declaration

  • archive: function
    • archive(): Promise<Entry>
    • Archives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.archive())
      .then((entry) => console.log(`Entry ${entry.sys.id} archived.`))
      .catch(console.error)

      Returns Promise<Entry>

      Object returned from the server with updated metadata.

  • delete: function
    • delete(): Promise<void>
    • Deletes this object on the server.

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.delete())
      .then(() => console.log(`Entry deleted.`))
      .catch(console.error)

      Returns Promise<void>

      Promise for the deletion. It contains no data, but the Promise error case should be handled.

  • getSnapshot: function
    • Gets a snapshot of an entry

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.getSnapshot('<snapshot_id>'))
      .then((snapshot) => console.log(snapshot))
      .catch(console.error)

      Parameters

      • snapshotId: string

        Id of the snapshot

      Returns Promise<Snapshot<EntryProps>>

  • getSnapshots: function
    • Gets all snapshots of an entry

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.getSnapshots())
      .then((snapshots) => console.log(snapshots.items))
      .catch(console.error)

      Returns Promise<Collection<Snapshot<EntryProps>, SnapshotProps<EntryProps>>>

  • isArchived: function
    • isArchived(): boolean
    • Checks if entry is archived. This means it's not exposed to the Delivery/Preview APIs.

      Returns boolean

  • isDraft: function
    • isDraft(): boolean
  • isPublished: function
    • isPublished(): boolean
    • Checks if the entry is published. A published entry might have unpublished changes

      Returns boolean

  • isUpdated: function
    • isUpdated(): boolean
    • Checks if the entry is updated. This means the entry was previously published but has unpublished changes.

      Returns boolean

  • publish: function
    • publish(): Promise<Entry>
    • Publishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.publish())
      .then((entry) => console.log(`Entry ${entry.sys.id} published.`))
      .catch(console.error)

      Returns Promise<Entry>

      Object returned from the server with updated metadata.

  • unarchive: function
    • unarchive(): Promise<Entry>
    • Unarchives the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.unarchive())
      .then((entry) => console.log(`Entry ${entry.sys.id} unarchived.`))
      .catch(console.error)

      Returns Promise<Entry>

      Object returned from the server with updated metadata.

  • unpublish: function
    • unpublish(): Promise<Entry>
    • Unpublishes the object

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => entry.unpublish())
      .then((entry) => console.log(`Entry ${entry.sys.id} unpublished.`))
      .catch(console.error)

      Returns Promise<Entry>

      Object returned from the server with updated metadata.

  • update: function
    • update(): Promise<Entry>
    • Sends an update to the server with any changes made to the object's properties

      example
      const contentful = require('contentful-management')
      
      const client = contentful.createClient({
        accessToken: '<content_management_api_key>'
      })
      
      client.getSpace('<space_id>')
      .then((space) => space.getEnvironment('<environment_id>'))
      .then((environment) => environment.getEntry('<entry_id>'))
      .then((entry) => {
        entry.fields.title['en-US'] = 'New entry title'
        return entry.update()
      })
      .then((entry) => console.log(`Entry ${entry.sys.id} updated.`))
      .catch(console.error)

      Returns Promise<Entry>

      Object returned from the server with updated changes.

EntryProps

EntryProps<T>: { fields: T; metadata?: MetadataProps; sys: EntityMetaSysProps }

Type parameters

  • T

Type declaration

Environment

EnvironmentAliasProps

EnvironmentAliasProps: { environment: { sys: MetaLinkProps }; sys: BasicMetaSysProps & { space: SysLink } }

Type declaration

EnvironmentMetaSys

EnvironmentMetaSys: BasicMetaSysProps & { aliasedEnvironment?: SysLink; aliases?: Array<SysLink>; space: SysLink; status: SysLink }

EnvironmentProps

EnvironmentProps: { name: string; sys: EnvironmentMetaSys }

Type declaration

FieldType

FieldType: { type: "Symbol" } | { type: "Text" } | { type: "RichText" } | { type: "Integer" } | { type: "Number" } | { type: "Date" } | { type: "Boolean" } | { type: "Object" } | { type: "Location" } | { linkType: "Asset"; type: "Link" } | { linkType: "Entry"; type: "Link" } | { items: { type: "Symbol" }; type: "Array" } | { items: { linkType: "Entry"; type: "Link" }; type: "Array" } | { items: { linkType: "Asset"; type: "Link" }; type: "Array" }

FreeFormParameters

FreeFormParameters: Record<string, any> | Array<any> | number | string | boolean

GetAppDefinitionParams

GetAppDefinitionParams: GetOrganizationParams & { appDefinitionId: string }

GetAppInstallationParams

GetAppInstallationParams: GetSpaceEnvironmentParams & { appDefinitionId: string }

GetContentTypeParams

GetContentTypeParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetEditorInterfaceParams

GetEditorInterfaceParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetOrganizationMembershipProps

GetOrganizationMembershipProps: GetOrganizationParams & { organizationMembershipId: string }

GetOrganizationParams

GetOrganizationParams: { organizationId: string }

Type declaration

  • organizationId: string

GetSnapshotForContentTypeParams

GetSnapshotForContentTypeParams: GetSpaceEnvironmentParams & { contentTypeId: string }

GetSnapshotForEntryParams

GetSnapshotForEntryParams: GetSpaceEnvironmentParams & { entryId: string }

GetSpaceEnvAliasParams

GetSpaceEnvAliasParams: GetSpaceParams & { environmentAliasId: string }

GetSpaceEnvironmentParams

GetSpaceEnvironmentParams: { environmentId: string; spaceId: string }

Type declaration

  • environmentId: string
  • spaceId: string

GetSpaceMembershipProps

GetSpaceMembershipProps: GetSpaceParams & { spaceMembershipId: string }

GetSpaceParams

GetSpaceParams: { spaceId: string }

Type declaration

  • spaceId: string

GetTagParams

GetTagParams: GetSpaceEnvironmentParams & { tagId: string }

GetTeamMembershipParams

GetTeamMembershipParams: GetTeamParams & { teamMembershipId: string }

GetTeamParams

GetTeamParams: { organizationId: string; teamId: string }

Type declaration

  • organizationId: string
  • teamId: string

GetTeamSpaceMembershipParams

GetTeamSpaceMembershipParams: GetSpaceParams & { teamSpaceMembershipId: string }

GetUiExtensionParams

GetUiExtensionParams: GetSpaceEnvironmentParams & { extensionId: string }

GetWebhookCallDetailsUrl

GetWebhookCallDetailsUrl: GetWebhookParams & { callId: string }

GetWebhookParams

GetWebhookParams: GetSpaceParams & { webhookDefinitionId: string }

ISO8601Timestamp

ISO8601Timestamp: string

String will be in ISO8601 datetime format e.g. 2013-06-26T13:57:24Z

IterableFn

IterableFn<P, T>: (params: P) => Promise<CollectionProp<T>>

Type parameters

  • P

  • T

Type declaration

KeyValueMap

KeyValueMap: Record<string, any>

LocaleProps

LocaleProps: { code: string; contentDeliveryApi: boolean; contentManagementApi: boolean; default: boolean; fallbackCode: string | null; internal_code: string; name: string; optional: boolean; sys: BasicMetaSysProps & { environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } } }

Type declaration

  • code: string

    Locale code (example: en-us)

  • contentDeliveryApi: boolean

    If the content under this locale should be available on the CDA (for public reading)

  • contentManagementApi: boolean

    If the content under this locale should be available on the CMA (for editing)

  • default: boolean

    If this is the default locale

  • fallbackCode: string | null

    Locale code to fallback to when there is not content for the current locale

  • internal_code: string

    Internal locale code

  • name: string

    Locale name

  • optional: boolean

    If the locale needs to be filled in on entries or not

  • sys: BasicMetaSysProps & { environment: { sys: MetaLinkProps }; space: { sys: MetaLinkProps } }

LocationType

LocationType: "app-config" | "entry-sidebar" | "entry-editor" | "dialog" | "page"

MarkOptional

MarkOptional<BaseType, Keys>: Except<BaseType, Keys> & Partial<Pick<BaseType, Keys>>

Type parameters

  • BaseType

  • Keys: keyof BaseType

OmitOrDelete

OmitOrDelete: "omitted" | "deleted"

Organization

OrganizationInvitationProps

OrganizationInvitationProps: { email: string; firstName: string; lastName: string; role: string; sys: MetaSysProps & { invitationUrl: string; organizationMembership: { sys: MetaLinkProps }; status: string; user: Record<string, any> | null } }

Type declaration

  • email: string
  • firstName: string
  • lastName: string
  • role: string
  • sys: MetaSysProps & { invitationUrl: string; organizationMembership: { sys: MetaLinkProps }; status: string; user: Record<string, any> | null }

OrganizationMembershipProps

OrganizationMembershipProps: { role: string; status: boolean; sys: MetaSysProps & { user: { sys: MetaLinkProps } } }

Type declaration

OrganizationProp

OrganizationProp: { name: string; sys: MetaSysProps }

Type declaration

PaginationQueryParams

PaginationQueryParams: { query?: PaginationQueryOptions }

Type declaration

ParameterOption

ParameterOption: string | {}

ParameterType

ParameterType: "Boolean" | "Symbol" | "Number" | "Enum"

ParamsType

ParamsType<T>: T extends (params: infer P) => any ? P : never

Type parameters

PersonalAccessTokenProp

PersonalAccessTokenProp: { name: string; revokedAt: null | string; scopes: "content_management_manage"[]; sys: MetaSysProps; token?: undefined | string }

Type declaration

  • name: string
  • revokedAt: null | string
  • scopes: "content_management_manage"[]
  • sys: MetaSysProps
  • Optional token?: undefined | string

PlainClientAPI

PlainClientAPI: ReturnType<typeof createPlainClient>

PlainClientDefaultParams

PlainClientDefaultParams: DefaultParams

PreviewApiKeyProps

PreviewApiKeyProps: { description: string; name: string; sys: MetaSysProps }

Type declaration

QueryParams

QueryParams: { query?: QueryOptions }

Type declaration

RestParamsType

RestParamsType<F>: F extends (p1: any, ...rest: infer REST) => any ? REST : never

Type parameters

  • F

RoleProps

RoleProps: { description?: undefined | string; name: string; permissions: { ContentDelivery: string[] | string; ContentModel: string[]; EnvironmentAliases: string[] | string; Environments: string[] | string; Settings: string[] | string }; policies: { actions: ActionType[] | "all"; constraint: ConstraintType; effect: string }[]; sys: BasicMetaSysProps & { space: SysLink } }

Type declaration

  • Optional description?: undefined | string
  • name: string
  • permissions: { ContentDelivery: string[] | string; ContentModel: string[]; EnvironmentAliases: string[] | string; Environments: string[] | string; Settings: string[] | string }

    Permissions for application sections

    • ContentDelivery: string[] | string
    • ContentModel: string[]
    • EnvironmentAliases: string[] | string
    • Environments: string[] | string
    • Settings: string[] | string
  • policies: { actions: ActionType[] | "all"; constraint: ConstraintType; effect: string }[]
  • sys: BasicMetaSysProps & { space: SysLink }

SchedulableActionType

SchedulableActionType: "publish" | "unpublish"

SchedulableEntityType

SchedulableEntityType: "Entry" | "Asset" | "Release"

ScheduledActionApi

ScheduledActionApi: { delete: any }

Type declaration

ScheduledActionProps

ScheduledActionProps: { action: SchedulableActionType; entity: Link<SchedulableEntityType>; environment?: undefined | { sys: MetaLinkProps }; scheduledFor: { datetime: ISO8601Timestamp }; sys: ScheduledActionSysProps }

Type declaration

ScheduledActionSysProps

ScheduledActionSysProps: { canceledAt?: ISO8601Timestamp; canceledBy?: undefined | { sys: MetaLinkProps }; createdAt: ISO8601Timestamp; createdBy: { sys: MetaLinkProps }; id: string; space: { sys: MetaLinkProps }; status: ScheduledActionStatus; type: "ScheduledAction" }

Type declaration

SdkHttpClient

SdkHttpClient: AxiosInstance & { cloneWithNewParams: (newParams: Record<string, any>) => SdkHttpClient; httpClientParams: Record<string, any> }

SnapshotProps

SnapshotProps<T>: { snapshot: T; sys: MetaSysProps & { snapshotEntityType: string; snapshotType: string } }

Type parameters

  • T

Type declaration

  • snapshot: T
  • sys: MetaSysProps & { snapshotEntityType: string; snapshotType: string }

Space

SpaceMemberProps

SpaceMemberProps: { admin: boolean; roles: { sys: MetaLinkProps }[]; sys: MetaSysProps }

Type declaration

SpaceMembershipProps

SpaceMembershipProps: { admin: boolean; name: string; roles: { sys: MetaLinkProps }[]; sys: MetaSysProps & { space: { sys: MetaLinkProps } } }

Type declaration

SpaceProps

SpaceProps: { name: string; sys: BasicMetaSysProps & { organization: { sys: { id: string } } } }

Type declaration

TagApi

TagApi: { delete: any; update: any }

Type declaration

TagCollectionProps

TagCollectionProps: { items: TagProps[]; sys: { type: "Array" }; total: number }

Type declaration

  • items: TagProps[]
  • sys: { type: "Array" }
    • type: "Array"
  • total: number

TagProps

TagProps: { name: string; sys: TagSysProps }

Type declaration

TagSysProps

TagSysProps: Pick<MetaSysProps, "id" | "version" | "createdAt" | "createdBy" | "updatedAt" | "updatedBy"> & { environment: SysLink; space: SysLink; type: "Tag" }

TeamMembershipProps

TeamMembershipProps: { admin: boolean; organizationMembershipId: string; sys: MetaSysProps & { organization: { sys: MetaLinkProps }; organizationMembership: { sys: MetaLinkProps }; team: { sys: MetaLinkProps } } }

Type declaration

TeamProps

TeamProps: { description: string; name: string; sys: MetaSysProps & { memberCount: number; organization: { sys: MetaLinkProps } } }

Type declaration

  • description: string

    Description of the team

  • name: string

    Name of the team

  • sys: MetaSysProps & { memberCount: number; organization: { sys: MetaLinkProps } }

    System metadata

TeamSpaceMembershipProps

TeamSpaceMembershipProps: { admin: boolean; roles: { sys: MetaLinkProps }[]; sys: MetaSysProps & { space: { sys: MetaLinkProps }; team: { sys: MetaLinkProps } } }

Type declaration

ThisContext

UIExtensionProps

UIExtensionProps: { extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }; parameters?: DefinedParameters; sys: UIExtensionSysProps }

Type declaration

  • extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }
    • fieldTypes: FieldType[]

      Field types where an extension can be used

    • name: string

      Extension name

    • Optional parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }

      Parameter definitions

    • Optional sidebar?: undefined | false | true

      Controls the location of the extension. If true it will be rendered on the sidebar instead of replacing the field's editing control

    • Optional src?: undefined | string

      URL where the root HTML document of the extension can be found

    • Optional srcdoc?: undefined | string

      String representation of the extension (e.g. inline HTML code)

  • Optional parameters?: DefinedParameters

    Values for installation parameters

  • sys: UIExtensionSysProps

UIExtensionSysProps

UIExtensionSysProps: BasicMetaSysProps & { environment: SysLink; space: SysLink; srcdocSha256?: undefined | string }

UpdateWebhookProps

UpdateWebhookProps: SetOptional<Except<WebhookProps, "sys">, "headers" | "name" | "topics" | "url">

UploadProps

UploadProps: { sys: MetaSysProps & { environment: SysLink; space: SysLink } }

Type declaration

UsageMetricEnum

UsageMetricEnum: "cda" | "cma" | "cpa" | "gql"

UsageProps

UsageProps: { dateRange: { endAt: string; startAt: string }; metric: UsageMetricEnum; sys: MetaSysProps & { organization?: undefined | { sys: MetaLinkProps } }; unitOfMeasure: string; usage: number; usagePerDay: {} }

Type declaration

  • dateRange: { endAt: string; startAt: string }

    Range of usage

    • endAt: string
    • startAt: string
  • metric: UsageMetricEnum

    Type of usage

  • sys: MetaSysProps & { organization?: undefined | { sys: MetaLinkProps } }

    System metadata

  • unitOfMeasure: string

    Unit of usage metric

  • usage: number

    Value of the usage

  • usagePerDay: {}

    Usage per day

    • [key: string]: number

UserProps

UserProps: { 2faEnabled: boolean; activated: boolean; avatarUrl: string; confirmed: boolean; cookieConsentData: string; email: string; firstName: string; lastName: string; signInCount: number; sys: BasicMetaSysProps }

Type declaration

  • 2faEnabled: boolean
  • activated: boolean

    Activation flag

  • avatarUrl: string

    Url to the users avatar

  • confirmed: boolean

    User confirmation flag

  • cookieConsentData: string
  • email: string

    Email address of the user

  • firstName: string

    First name of the user

  • lastName: string

    Last name of the user

  • signInCount: number

    Number of sign ins

  • sys: BasicMetaSysProps

    System metadata

WebhookCallDetailsProps

WebhookCallDetailsProps: { errors: any[]; eventType: string; request: WebhookCallRequest; requestAt: string; response: WebhookCallResponse; responseAt: string; statusCode: number; sys: WebhookCallDetailsSys; url: string }

Type declaration

  • errors: any[]

    Errors

  • eventType: string

    Type of the webhook

  • request: WebhookCallRequest

    Request object

  • requestAt: string

    Timestamp of the request

  • response: WebhookCallResponse

    Request object

  • responseAt: string

    Timestamp of the response

  • statusCode: number

    Status code of the request

  • sys: WebhookCallDetailsSys

    System metadata

  • url: string

    Url of the request

WebhookCallDetailsSys

WebhookCallDetailsSys: Except<BasicMetaSysProps, "version" | "updatedAt" | "updatedBy">

WebhookCallOverviewProps

WebhookCallOverviewProps: Except<WebhookCallDetailsProps, "request" | "response">

WebhookCallRequest

WebhookCallRequest: { body: string; headers: {}; method: string; url: string }

Type declaration

  • body: string
  • headers: {}
    • [key: string]: string
  • method: string
  • url: string

WebhookCallResponse

WebhookCallResponse: WebhookCallRequest & { statusCode: number }

WebhookCalls

WebhookCalls: { healthy: number; total: number }

Type declaration

  • healthy: number
  • total: number

WebhookFilter

WebhookHeader

WebhookHeader: { key: string; secret?: undefined | false | true; value: string }

Type declaration

  • key: string
  • Optional secret?: undefined | false | true
  • value: string

WebhookHealthProps

WebhookHealthProps: { calls: WebhookCalls; sys: WebhookHealthSys & { space: { sys: MetaLinkProps } } }

Type declaration

WebhookHealthSys

WebhookHealthSys: Except<BasicMetaSysProps, "version" | "updatedAt" | "updatedBy" | "createdAt">

WebhookProps

WebhookProps: { filters?: WebhookFilter[]; headers: Array<WebhookHeader>; httpBasicPassword?: undefined | string; httpBasicUsername?: undefined | string; name: string; sys: BasicMetaSysProps & { space: SysLink }; topics: string[]; transformation?: WebhookTransformation; url: string }

Type declaration

  • Optional filters?: WebhookFilter[]

    Webhook filters

  • headers: Array<WebhookHeader>

    Headers that should be appended to the webhook request

  • Optional httpBasicPassword?: undefined | string

    Password for basic http auth

  • Optional httpBasicUsername?: undefined | string

    Username for basic http auth

  • name: string

    Webhook name

  • sys: BasicMetaSysProps & { space: SysLink }

    System metadata

  • topics: string[]

    Topics the webhook wants to subscribe to

  • Optional transformation?: WebhookTransformation

    Transformation to apply

  • url: string

    Webhook url

WebhookTransformation

WebhookTransformation: { body?: JsonValue; contentType?: null | "application/vnd.contentful.management.v1+json" | "application/vnd.contentful.management.v1+json; charset=utf-8" | "application/json" | "application/json; charset=utf-8" | "application/x-www-form-urlencoded" | "application/x-www-form-urlencoded; charset=utf-8"; includeContentLength?: boolean | null; method?: null | "POST" | "GET" | "PUT" | "PATCH" | "DELETE" }

Type declaration

  • Optional body?: JsonValue
  • Optional contentType?: null | "application/vnd.contentful.management.v1+json" | "application/vnd.contentful.management.v1+json; charset=utf-8" | "application/json" | "application/json; charset=utf-8" | "application/x-www-form-urlencoded" | "application/x-www-form-urlencoded; charset=utf-8"
  • Optional includeContentLength?: boolean | null
  • Optional method?: null | "POST" | "GET" | "PUT" | "PATCH" | "DELETE"

WrapParams

WrapParams: { defaults?: DefaultParams; http: AxiosInstance }

Type declaration

Variables

Const ASSET_PROCESSING_CHECK_RETRIES

ASSET_PROCESSING_CHECK_RETRIES: 10 = 10

Const ASSET_PROCESSING_CHECK_WAIT

ASSET_PROCESSING_CHECK_WAIT: 3000 = 3000

Asset processing

Const wrapScheduledActionCollection

wrapScheduledActionCollection: (Anonymous function) = wrapCollection(wrapScheduledAction)

Const wrapTagCollection

wrapTagCollection: (Anonymous function) = wrapCollection(wrapTag)

Functions

Const archive

Const asIterator

  • asIterator<P, T, F>(fn: F, params: ParamsType<F>): AsyncIterable<T>

checkIfAssetHasUrl

  • checkIfAssetHasUrl(http: AxiosInstance, params: GetSpaceEnvironmentParams & { assetId: string }, __namedParameters: { checkCount: number; locale: string; processingCheckRetries: number; processingCheckWait: number; reject: (err: Error) => unknown; resolve: (asset: AssetProps) => unknown }): Promise<void>
  • Parameters

    • http: AxiosInstance
    • params: GetSpaceEnvironmentParams & { assetId: string }
    • __namedParameters: { checkCount: number; locale: string; processingCheckRetries: number; processingCheckWait: number; reject: (err: Error) => unknown; resolve: (asset: AssetProps) => unknown }
      • checkCount: number
      • locale: string
      • processingCheckRetries: number
      • processingCheckWait: number
      • reject: (err: Error) => unknown
          • (err: Error): unknown
          • Parameters

            • err: Error

            Returns unknown

      • resolve: (asset: AssetProps) => unknown

    Returns Promise<void>

Const create

createApiKeyApi

  • createApiKeyApi(http: AxiosInstance): { delete: any; update: any }

createAppDefinitionApi

  • createAppDefinitionApi(http: AxiosInstance): { delete: any; update: any }

createAppInstallationApi

  • createAppInstallationApi(http: AxiosInstance): { delete: any; update: any }

createAssetApi

  • createAssetApi(http: AxiosInstance): AssetApi

createClient

createClientApi

  • createClientApi(__namedParameters: { http: AxiosInstance }): { createPersonalAccessToken: any; createSpace: any; getCurrentUser: any; getOrganization: any; getOrganizationUsage: any; getOrganizations: any; getPersonalAccessToken: any; getPersonalAccessTokens: any; getSpace: any; getSpaceUsage: any; getSpaces: any; rawRequest: any }
  • Parameters

    • __namedParameters: { http: AxiosInstance }
      • http: AxiosInstance

    Returns { createPersonalAccessToken: any; createSpace: any; getCurrentUser: any; getOrganization: any; getOrganizationUsage: any; getOrganizations: any; getPersonalAccessToken: any; getPersonalAccessTokens: any; getSpace: any; getSpaceUsage: any; getSpaces: any; rawRequest: any }

    • createPersonalAccessToken: function
      • Creates a personal access token

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.createPersonalAccessToken(
         {
           "name": "My Token",
           "scope": [
             "content_management_manage"
           ]
         }
        )
        .then(personalAccessToken => console.log(personalAccessToken.token))
        .catch(console.error)

        Parameters

        Returns Promise<PersonalAccessToken>

        Promise for a Token

    • createSpace: function
      • createSpace(spaceData: Omit<SpaceProps, "sys">, organizationId: string): Promise<Space>
      • Creates a space

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.createSpace({
          name: 'Name of new space'
        })
        .then((space) => console.log(space))
        .catch(console.error)

        Parameters

        • spaceData: Omit<SpaceProps, "sys">

          Object representation of the Space to be created

        • organizationId: string

          Organization ID, if the associated token can manage more than one organization.

        Returns Promise<Space>

        Promise for the newly created Space

    • getCurrentUser: function
      • getCurrentUser(): Promise<User>
      • Gets the authenticated user

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getCurrentUser()
        .then(user => console.log(user.firstName))
        .catch(console.error)

        Returns Promise<User>

        Promise for a User

    • getOrganization: function
      • Gets an organization

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((org) => console.log(org))
        .catch(console.error)

        Parameters

        • id: string

          Organization ID

        Returns Promise<Organization>

        Promise for a Organization

    • getOrganizationUsage: function
      • Get organization usage grouped by metric

        example
        
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganizationUsage('<organizationId>', {
           'metric[in]': 'cma,gql',
           'dateRange.startAt': '2019-10-22',
           'dateRange.endAt': '2019-11-10'
           }
        })
        .then(result => console.log(result.items))
        .catch(console.error)

        Parameters

        • organizationId: string

          Id of an organization

        • Default value query: QueryOptions = {}

          Query parameters

        Returns Promise<Collection<Usage, UsageProps>>

        Promise of a collection of usages

    • getOrganizations: function
      • Gets a collection of Organizations

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganizations()
        .then(result => console.log(result.items))
        .catch(console.error)

        Returns Promise<Collection<Organization, OrganizationProp>>

        Promise for a collection of Organizations

    • getPersonalAccessToken: function
      • Gets a personal access token

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getPersonalAccessToken(tokenId)
        .then(token => console.log(token.token))
        .catch(console.error)

        Parameters

        • tokenId: string

        Returns Promise<PersonalAccessToken>

        Promise for a Token

    • getPersonalAccessTokens: function
      • Gets all personal access tokens

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getPersonalAccessTokens()
        .then(response => console.log(reponse.items))
        .catch(console.error)

        Returns Promise<Collection<PersonalAccessToken, PersonalAccessTokenProp>>

        Promise for a Token

    • getSpace: function
      • getSpace(spaceId: string): Promise<Space>
      • Gets a space

        Parameters

        • spaceId: string

          Space ID

        Returns Promise<Space>

        Promise for a Space

        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => console.log(space))
        .catch(console.error)
    • getSpaceUsage: function
      • Get organization usage grouped by space and metric

        Parameters

        • organizationId: string

          Id of an organization

        • Default value query: UsageQuery = {}

          Query parameters

        Returns Promise<Collection<Usage, UsageProps>>

        Promise of a collection of usages

        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpaceUsage('<organizationId>', {
           skip: 0,
           limit: 10,
           'metric[in]': 'cda,cpa,gql',
           'dateRange.startAt': '2019-10-22',
           'dateRange.endAt': '2020-11-30'
           }
        })
        .then(result => console.log(result.items))
        .catch(console.error)
    • getSpaces: function
      • Gets all spaces

        Parameters

        Returns Promise<Collection<Space, SpaceProps>>

        Promise for a collection of Spaces

        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpaces()
        .then((response) => console.log(response.items))
        .catch(console.error)
    • rawRequest: function
      • rawRequest(opts: AxiosRequestConfig): Promise<any>
      • Make a custom request to the Contentful management API's /spaces endpoint

        Parameters

        Returns Promise<any>

        Promise for the response data

        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.rawRequest({
          method: 'GET',
          url: '/custom/path'
        })
        .then((responseData) => console.log(responseData))
        .catch(console.error)

createContentTypeApi

createDeleteScheduledAction

  • createDeleteScheduledAction(http: AxiosInstance): () => Promise<ScheduledAction>

createEditorInterfaceApi

  • createEditorInterfaceApi(http: AxiosInstance): { getControlForField: any; update: any }

createEntryApi

  • createEntryApi(http: AxiosInstance): EntryApi

createEnvironmentAliasApi

  • createEnvironmentAliasApi(http: AxiosInstance): { delete: any; update: any }

createEnvironmentApi

  • createEnvironmentApi(__namedParameters: { http: AxiosInstance; httpUpload: AxiosInstance }): { createAppInstallation: any; createAsset: any; createAssetFromFiles: any; createAssetWithId: any; createContentType: any; createContentTypeWithId: any; createEntry: any; createEntryWithId: any; createLocale: any; createTag: any; createUiExtension: any; createUiExtensionWithId: any; createUpload: any; delete: any; getAppInstallation: any; getAppInstallations: any; getAsset: any; getAssetFromData: any; getAssets: any; getContentType: any; getContentTypeSnapshots: any; getContentTypes: any; getEditorInterfaceForContentType: any; getEditorInterfaces: any; getEntries: any; getEntry: any; getEntryFromData: any; getEntrySnapshots: any; getLocale: any; getLocales: any; getTag: any; getTags: any; getUiExtension: any; getUiExtensions: any; getUpload: any; update: any }
  • Creates API object with methods to access the Environment API

    Parameters

    • __namedParameters: { http: AxiosInstance; httpUpload: AxiosInstance }
      • http: AxiosInstance
      • httpUpload: AxiosInstance

    Returns { createAppInstallation: any; createAsset: any; createAssetFromFiles: any; createAssetWithId: any; createContentType: any; createContentTypeWithId: any; createEntry: any; createEntryWithId: any; createLocale: any; createTag: any; createUiExtension: any; createUiExtensionWithId: any; createUpload: any; delete: any; getAppInstallation: any; getAppInstallations: any; getAsset: any; getAssetFromData: any; getAssets: any; getContentType: any; getContentTypeSnapshots: any; getContentTypes: any; getEditorInterfaceForContentType: any; getEditorInterfaces: any; getEntries: any; getEntry: any; getEntryFromData: any; getEntrySnapshots: any; getLocale: any; getLocales: any; getTag: any; getTags: any; getUiExtension: any; getUiExtensions: any; getUpload: any; update: any }

    • createAppInstallation: function
      • Gets an App Installation

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
         .then((space) => space.getEnvironment('<environment-id>'))
         .then((environment) => environment.createAppInstallation('<app_definition_id>', {
           parameters: {
             someParameter: someValue
           }
          })
         .then((appInstallation) => console.log(appInstallation))
         .catch(console.error)

        Parameters

        Returns Promise<AppInstallation>

        Promise for an App Installation

    • createAsset: function
      • Creates a Asset. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.

        example
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        // Create asset
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createAsset({
          fields: {
            title: {
              'en-US': 'Playsam Streamliner'
           },
           file: {
              'en-US': {
                contentType: 'image/jpeg',
               fileName: 'example.jpeg',
               upload: 'https://example.com/example.jpg'
             }
           }
          }
        }))
        .then((asset) => asset.processForLocale("en-US")) // OR asset.processForAllLocales()
        .then((asset) => console.log(asset))
        .catch(console.error)

        Parameters

        • data: CreateAssetProps

          Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.

        Returns Promise<Asset>

        Promise for the newly created Asset

    • createAssetFromFiles: function
      • Creates a Asset based on files. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.

        example
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createAssetFromFiles({
          fields: {
            file: {
              'en-US': {
                 contentType: 'image/jpeg',
                 fileName: 'filename_english.jpg',
                 file: createReadStream('path/to/filename_english.jpg')
              },
              'de-DE': {
                 contentType: 'image/svg+xml',
                 fileName: 'filename_german.svg',
                 file: '<svg><path fill="red" d="M50 50h150v50H50z"/></svg>'
              }
            }
          }
        }))
        .then((asset) => console.log(asset))
        .catch(console.error)

        Parameters

        • data: Omit<AssetFileProp, "sys">

          Object representation of the Asset to be created. Note that the field object should have an uploadFrom property on asset creation, which will be removed and replaced with an url property when processing is finished.

        Returns Promise<Asset>

        Promise for the newly created Asset

    • createAssetWithId: function
      • Creates a Asset with a custom ID. After creation, call asset.processForLocale or asset.processForAllLocales to start asset processing.

        example
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        // Create asset
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createAssetWithId('<asset_id>', {
          title: {
            'en-US': 'Playsam Streamliner'
          },
          file: {
            'en-US': {
              contentType: 'image/jpeg',
              fileName: 'example.jpeg',
              upload: 'https://example.com/example.jpg'
            }
          }
        }))
        .then((asset) => asset.process())
        .then((asset) => console.log(asset))
        .catch(console.error)

        Parameters

        • id: string

          Asset ID

        • data: CreateAssetProps

          Object representation of the Asset to be created. Note that the field object should have an upload property on asset creation, which will be removed and replaced with an url property when processing is finished.

        Returns Promise<Asset>

        Promise for the newly created Asset

    • createContentType: function
      • Creates a Content Type

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createContentType({
          name: 'Blog Post',
          fields: [
            {
              id: 'title',
              name: 'Title',
              required: true,
              localized: false,
              type: 'Text'
            }
          ]
        }))
        .then((contentType) => console.log(contentType))
        .catch(console.error)

        Parameters

        Returns Promise<ContentType>

        Promise for the newly created Content Type

    • createContentTypeWithId: function
      • Creates a Content Type with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createContentTypeWithId('<content-type-id>', {
          name: 'Blog Post',
          fields: [
            {
              id: 'title',
              name: 'Title',
              required: true,
              localized: false,
              type: 'Text'
            }
          ]
        }))
        .then((contentType) => console.log(contentType))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          Content Type ID

        • data: CreateContentTypeProps

          Object representation of the Content Type to be created

        Returns Promise<ContentType>

        Promise for the newly created Content Type

    • createEntry: function
      • createEntry(contentTypeId: string, data: Omit<EntryProps, "sys">): Promise<Entry>
      • Creates a Entry

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createEntry('<content_type_id>', {
          fields: {
            title: {
              'en-US': 'Entry title'
            }
          }
        }))
        .then((entry) => console.log(entry))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          The Content Type ID of the newly created Entry

        • data: Omit<EntryProps, "sys">

          Object representation of the Entry to be created

        Returns Promise<Entry>

        Promise for the newly created Entry

    • createEntryWithId: function
      • Creates a Entry with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        // Create entry
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createEntryWithId('<content_type_id>', '<entry_id>', {
          fields: {
            title: {
              'en-US': 'Entry title'
            }
          }
        }))
        .then((entry) => console.log(entry))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          The Content Type of the newly created Entry

        • id: string

          Entry ID

        • data: CreateEntryProps

          Object representation of the Entry to be created

        Returns Promise<Entry>

        Promise for the newly created Entry

    • createLocale: function
      • Creates a Locale

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        // Create locale
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createLocale({
          name: 'German (Austria)',
          code: 'de-AT',
          fallbackCode: 'de-DE',
          optional: true
        }))
        .then((locale) => console.log(locale))
        .catch(console.error)

        Parameters

        Returns Promise<Locale>

        Promise for the newly created Locale

    • createTag: function
      • createTag(id: string, name: string): Promise<Tag>
    • createUiExtension: function
      • Creates a UI Extension

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createUiExtension({
          extension: {
            name: 'My awesome extension',
            src: 'https://example.com/my',
            fieldTypes: [
              {
                type: 'Symbol'
              },
              {
                type: 'Text'
              }
            ],
            sidebar: false
          }
        }))
        .then((uiExtension) => console.log(uiExtension))
        .catch(console.error)

        Parameters

        Returns Promise<UIExtension>

        Promise for the newly created UI Extension

    • createUiExtensionWithId: function
      • Creates a UI Extension with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createUiExtensionWithId('<extension_id>', {
          extension: {
            name: 'My awesome extension',
            src: 'https://example.com/my',
            fieldTypes: [
              {
                type: 'Symbol'
              },
              {
                type: 'Text'
              }
            ],
            sidebar: false
          }
        }))
        .then((uiExtension) => console.log(uiExtension))
        .catch(console.error)

        Parameters

        • id: string

          Extension ID

        • data: CreateUIExtensionProps

          Object representation of the UI Extension to be created

        Returns Promise<UIExtension>

        Promise for the newly created UI Extension

    • createUpload: function
      • createUpload(data: { file: string | ArrayBuffer | Stream }): Promise<{ delete: any } & UploadProps & { toPlainObject: any }>
      • Creates a Upload.

        example
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        const uploadStream = createReadStream('path/to/filename_english.jpg')
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.createUpload({file: uploadStream})
        .then((upload) => console.log(upload))
        .catch(console.error)

        Parameters

        • data: { file: string | ArrayBuffer | Stream }

          Object with file information.

          • file: string | ArrayBuffer | Stream

        Returns Promise<{ delete: any } & UploadProps & { toPlainObject: any }>

        Upload object containing information about the uploaded file.

    • delete: function
      • delete(): Promise<void>
      • Deletes the environment

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.delete())
        .then(() => console.log('Environment deleted.'))
        .catch(console.error)

        Returns Promise<void>

        Promise for the deletion. It contains no data, but the Promise error case should be handled.

    • getAppInstallation: function
      • Gets an App Installation

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
         .then((space) => space.getEnvironment('<environment-id>'))
         .then((environment) => environment.getAppInstallation('<app-definition-id>'))
         .then((appInstallation) => console.log(appInstallation))
         .catch(console.error)

        Parameters

        • id: string

          AppDefintion ID

        Returns Promise<AppInstallation>

        Promise for an App Installation

    • getAppInstallations: function
      • Gets a collection of App Installation

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
         .then((space) => space.getEnvironment('<environment-id>'))
         .then((environment) => environment.getAppInstallations()
         .then((response) => console.log(response.items))
         .catch(console.error)

        Returns Promise<Collection<AppInstallation, AppInstallationProps>>

        Promise for a collection of App Installations

    • getAsset: function
      • Gets an Asset Warning: if you are using the select operator, when saving, any field that was not selected will be removed from your entry in the backend

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getAsset('<asset_id>'))
        .then((asset) => console.log(asset))
        .catch(console.error)

        Parameters

        • id: string

          Asset ID

        • Default value query: QueryOptions = {}

          Object with search parameters. In this method it's only useful for locale.

        Returns Promise<Asset>

        Promise for an Asset

    • getAssetFromData: function
      • Creates SDK Asset object (locally) from entry data

        example
        environment.getAsset('asset_id').then(asset => {
        
          // Build a plainObject in order to make it usable for React (saving in state or redux)
          const plainObject = asset.toPlainObject();
        
          // The asset is being updated in some way as plainObject:
          const updatedPlainObject = {
            ...plainObject,
            fields: {
              ...plainObject.fields,
              title: {
                'en-US': 'updatedTitle'
              }
            }
          };
        
          // Rebuild an sdk object out of the updated plainObject:
          const assetWithMethodsAgain = environment.getAssetFromData(updatedPlainObject);
        
          // Update with help of the sdk method:
          assetWithMethodsAgain.update();
        
        });

        Parameters

        Returns Asset

        Asset

    • getAssets: function
      • Gets a collection of Assets Warning: if you are using the select operator, when saving, any field that was not selected will be removed from your entry in the backend

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getAssets())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<Asset, AssetProps>>

        Promise for a collection of Assets

    • getContentType: function
      • getContentType(contentTypeId: string): Promise<ContentType>
      • Gets a Content Type

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getContentType('<content_type_id>'))
        .then((contentType) => console.log(contentType))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          Content Type ID

        Returns Promise<ContentType>

        Promise for a Content Type

    • getContentTypeSnapshots: function
      • Gets all snapshots of a contentType

        func

        getContentTypeSnapshots

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getContentTypeSnapshots('<contentTypeId>'))
        .then((snapshots) => console.log(snapshots.items))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          Content Type ID

        • Default value query: QueryOptions = {}

          query additional query paramaters

        Returns Promise<Collection<Snapshot<ContentTypeProps>, SnapshotProps<ContentTypeProps>>>

        Promise for a collection of Content Type Snapshots

    • getContentTypes: function
      • Gets a collection of Content Types

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getContentTypes())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<ContentType, ContentTypeProps>>

        Promise for a collection of Content Types

    • getEditorInterfaceForContentType: function
      • getEditorInterfaceForContentType(contentTypeId: string): Promise<EditorInterface>
      • Gets an EditorInterface for a ContentType

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getEditorInterfaceForContentType('<content_type_id>'))
        .then((EditorInterface) => console.log(EditorInterface))
        .catch(console.error)

        Parameters

        • contentTypeId: string

          Content Type ID

        Returns Promise<EditorInterface>

        Promise for an EditorInterface

    • getEditorInterfaces: function
      • Gets all EditorInterfaces

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getEditorInterfaces())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<EditorInterface, EditorInterfaceProps>>

        Promise for a collection of EditorInterface

    • getEntries: function
      • Gets a collection of Entries Warning: if you are using the select operator, when saving, any field that was not selected will be removed from your entry in the backend

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getEntries({'content_type': 'foo'})) // you can add more queries as 'key': 'value'
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<Entry, EntryProps<Record<string, any>>>>

        Promise for a collection of Entries

    • getEntry: function
      • Gets an Entry Warning: if you are using the select operator, when saving, any field that was not selected will be removed from your entry in the backend

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getEntry('<entry-id>'))
        .then((entry) => console.log(entry))
        .catch(console.error)

        Parameters

        • id: string

          Entry ID

        • Default value query: QueryOptions = {}

          Object with search parameters. In this method it's only useful for locale.

        Returns Promise<Entry>

        Promise for an Entry

    • getEntryFromData: function
      • Creates SDK Entry object (locally) from entry data

        example
        environment.getEntry('entryId').then(entry => {
        
          // Build a plainObject in order to make it usable for React (saving in state or redux)
          const plainObject = entry.toPlainObject();
        
          // The entry is being updated in some way as plainObject:
          const updatedPlainObject = {
            ...plainObject,
            fields: {
              ...plainObject.fields,
              title: {
                'en-US': 'updatedTitle'
              }
            }
          };
        
          // Rebuild an sdk object out of the updated plainObject:
          const entryWithMethodsAgain = environment.getEntryFromData(updatedPlainObject);
        
          // Update with help of the sdk method:
          entryWithMethodsAgain.update();
        
        });

        Parameters

        Returns Entry

        Entry

    • getEntrySnapshots: function
      • Gets all snapshots of an entry

        func

        getEntrySnapshots

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getEntrySnapshots('<entry_id>'))
        .then((snapshots) => console.log(snapshots.items))
        .catch(console.error)

        Parameters

        • entryId: string

          Entry ID

        • Default value query: QueryOptions = {}

          query additional query paramaters

        Returns Promise<Collection<Snapshot<EntryProps<Record<string, any>>>, SnapshotProps<EntryProps<Record<string, any>>>>>

        Promise for a collection of Entry Snapshots

    • getLocale: function
      • getLocale(localeId: string): Promise<Locale>
      • Gets a Locale

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getLocale('<locale_id>'))
        .then((locale) => console.log(locale))
        .catch(console.error)

        Parameters

        • localeId: string

          Locale ID

        Returns Promise<Locale>

        Promise for an Locale

    • getLocales: function
      • Gets a collection of Locales

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getLocales())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<Locale, LocaleProps>>

        Promise for a collection of Locales

    • getTag: function
      • getTag(id: string): Promise<Tag>
    • getTags: function
    • getUiExtension: function
      • Gets an UI Extension

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getUiExtension('<extension-id>'))
        .then((uiExtension) => console.log(uiExtension))
        .catch(console.error)

        Parameters

        • id: string

          Extension ID

        Returns Promise<UIExtension>

        Promise for an UI Extension

    • getUiExtensions: function
      • Gets a collection of UI Extension

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getUiExtensions()
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<UIExtension, UIExtensionProps>>

        Promise for a collection of UI Extensions

    • getUpload: function
      • getUpload(id: string): Promise<{ delete: any } & UploadProps & { toPlainObject: any }>
      • Gets an Upload

        example
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        const uploadStream = createReadStream('path/to/filename_english.jpg')
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => environment.getUpload('<upload-id>')
        .then((upload) => console.log(upload))
        .catch(console.error)

        Parameters

        • id: string

          Upload ID

        Returns Promise<{ delete: any } & UploadProps & { toPlainObject: any }>

        Promise for an Upload

    • update: function
      • Updates the environment

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environment-id>'))
        .then((environment) => {
          environment.name = 'New name'
          return environment.update()
        })
        .then((environment) => console.log(`Environment ${environment.sys.id} renamed.`)
        .catch(console.error)

        Returns Promise<Environment>

        Promise for the updated environment.

Const createFromFiles

  • createFromFiles(httpUpload: AxiosInstance): (Anonymous function)

createLocaleApi

  • createLocaleApi(http: AxiosInstance): { delete: any; update: any }

createOrganizationApi

  • createOrganizationApi(__namedParameters: { http: AxiosInstance }): { createAppDefinition: any; createOrganizationInvitation: any; createTeam: any; createTeamMembership: any; getAppDefinition: any; getAppDefinitions: any; getOrganizationInvitation: any; getOrganizationMembership: any; getOrganizationMemberships: any; getOrganizationSpaceMembership: any; getOrganizationSpaceMemberships: any; getTeam: any; getTeamMembership: any; getTeamMemberships: any; getTeamSpaceMembership: any; getTeamSpaceMemberships: any; getTeams: any; getUser: any; getUsers: any }
  • Creates API object with methods to access the Organization API

    Parameters

    • __namedParameters: { http: AxiosInstance }
      • http: AxiosInstance

    Returns { createAppDefinition: any; createOrganizationInvitation: any; createTeam: any; createTeamMembership: any; getAppDefinition: any; getAppDefinitions: any; getOrganizationInvitation: any; getOrganizationMembership: any; getOrganizationMemberships: any; getOrganizationSpaceMembership: any; getOrganizationSpaceMemberships: any; getTeam: any; getTeamMembership: any; getTeamMemberships: any; getTeamSpaceMembership: any; getTeamSpaceMemberships: any; getTeams: any; getUser: any; getUsers: any }

    • createAppDefinition: function
      • Creates an app definition

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((org) => org.createAppDefinition({
           name: 'Example app',
           locations: [{ location: 'app-config' }],
           src: "http://my-app-host.com/my-app"
         }))
        .then((appDefinition) => console.log(appDefinition))
        .catch(console.error)

        Parameters

        Returns Promise<AppDefinition>

        Promise for the newly created AppDefinition

    • createOrganizationInvitation: function
      • Create an Invitation in Organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
         .then((organization) => organization.createOrganizationInvitation({
           email: 'user.email@example.com'
           firstName: 'User First Name'
           lastName: 'User Last Name'
           role: 'developer'
         })
        .catch(console.error)

        Parameters

        Returns Promise<OrganizationInvitation>

        Promise for a OrganizationInvitation in an organization

    • createTeam: function
      • Creates a Team

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((org) => org.createTeam({
           name: 'new team',
           description: 'new team description'
         }))
        .then((team) => console.log(team))
        .catch(console.error)

        Parameters

        Returns Promise<Team>

    • createTeamMembership: function
      • Creates a Team membership

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organizationId')
        .then((org) => org.createTeamMembership('teamId', {
           admin: true,
           organizationMembershipId: 'organizationMembershipId'
         }))
        .then((teamMembership) => console.log(teamMembership))
        .catch(console.error)

        Parameters

        • teamId: string

          Id of the team the membership will be created in

        • data: CreateTeamMembershipProps

          Object representation of the Team Membership to be created

        Returns Promise<TeamMembership>

        Promise for the newly created TeamMembership

    • getAppDefinition: function
      • Gets an app definition

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((org) => org.getAppDefinition('<app_definition_id>'))
        .then((appDefinition) => console.log(appDefinition))
        .catch(console.error)

        Parameters

        • id: string

        Returns Promise<AppDefinition>

        Promise for an App Definition

    • getAppDefinitions: function
      • Gets all app definitions

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((org) => org.getAppDefinitions())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<AppDefinition, AppDefinitionProps>>

        Promise for a collection of App Definitions

    • getOrganizationInvitation: function
      • Gets an Invitation in Organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<org_id>')
        .then((organization) => organization.getOrganizationInvitation('invitation_id'))
        .then((invitation) => console.log(invitation))
        .catch(console.error)

        Parameters

        • invitationId: string

        Returns Promise<OrganizationInvitation>

        Promise for a OrganizationInvitation in an organization

    • getOrganizationMembership: function
      • Gets an Organization Membership

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organization_id')
        .then((organization) => organization.getOrganizationMembership('organizationMembership_id'))
        .then((organizationMembership) => console.log(organizationMembership))
        .catch(console.error)

        Parameters

        • id: string

          Organization Membership ID

        Returns Promise<OrganizationMembership>

        Promise for an Organization Membership

    • getOrganizationMemberships: function
      • Gets a collection of Organization Memberships

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organization_id')
        .then((organization) => organization.getOrganizationMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<OrganizationMembership, OrganizationMembershipProps>>

        Promise for a collection of Organization Memberships

    • getOrganizationSpaceMembership: function
      • Gets an Space Membership in Organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organization_id')
        .then((organization) => organization.getOrganizationSpaceMembership('organizationSpaceMembership_id'))
        .then((organizationMembership) => console.log(organizationMembership))
        .catch(console.error)

        Parameters

        • id: string

          Organiztion Space Membership ID

        Returns Promise<SpaceMembership>

        Promise for a Space Membership in an organization

    • getOrganizationSpaceMemberships: function
      • Gets a collection Space Memberships in organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organization_id')
        .then((organization) => organization.getOrganizationSpaceMemberships()) // you can add queries like 'limit': 100
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<SpaceMembership, SpaceMembershipProps>>

        Promise for a Space Membership collection across all spaces in the organization

    • getTeam: function
      • getTeam(teamId: string): Promise<Team>
      • Gets an Team

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('orgId')
        .then((organization) => organization.getTeam('teamId'))
        .then((team) => console.log(team))
        .catch(console.error)

        Parameters

        • teamId: string

        Returns Promise<Team>

    • getTeamMembership: function
      • getTeamMembership(teamId: string, teamMembershipId: string): Promise<TeamMembership>
      • Gets an Team Membership from the team with given teamId

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organizationId')
        .then((organization) => organization.getTeamMembership('teamId', 'teamMembership_id'))
        .then((teamMembership) => console.log(teamMembership))
        .catch(console.error)

        Parameters

        • teamId: string
        • teamMembershipId: string

        Returns Promise<TeamMembership>

        Promise for an Team Membership

    • getTeamMemberships: function
      • Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization.

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organizationId')
        .then((organization) => organization.getTeamMemberships('teamId'))
        .then((teamMemberships) => console.log(teamMemberships))
        .catch(console.error)

        Parameters

        • Default value opts: { query?: QueryOptions; teamId?: undefined | string } = {}
          • Optional query?: QueryOptions
          • Optional teamId?: undefined | string

        Returns Promise<Collection<TeamMembership, TeamMembershipProps>>

        Promise for a Team Membership Collection

    • getTeamSpaceMembership: function
      • Get a Team Space Membership with given teamSpaceMembershipId

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organizationId')
        .then((organization) => organization.getTeamSpaceMembership('teamSpaceMembershipId'))
        .then((teamSpaceMembership) => console.log(teamSpaceMembership))
        .catch(console.error)]

        Parameters

        • teamSpaceMembershipId: string

        Returns Promise<TeamSpaceMembership>

        Promise for a Team Space Membership

    • getTeamSpaceMemberships: function
      • Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization.

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('organizationId')
        .then((organization) => organization.getTeamSpaceMemberships('teamId'))
        .then((teamSpaceMemberships) => console.log(teamSpaceMemberships))
        .catch(console.error)

        Parameters

        • Default value opts: { query?: QueryOptions; teamId?: undefined | string } = {}
          • Optional query?: QueryOptions
          • Optional teamId?: undefined | string

        Returns Promise<Collection<TeamSpaceMembership, TeamSpaceMembershipProps>>

        Promise for a Team Space Membership Collection

    • getTeams: function
      • Gets all Teams in an organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('orgId')
        .then((organization) => organization.getTeams())
        .then((teams) => console.log(teams))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<Team, TeamProps>>

    • getUser: function
      • getUser(id: string): Promise<User>
      • Gets a User

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<organization_id>')
        .then((organization) => organization.getUser('id'))
        .then((user) => console.log(user))
        .catch(console.error)

        Parameters

        • id: string

        Returns Promise<User>

        Promise for a User

    • getUsers: function
      • Gets a collection of Users in organization

        example
        const contentful = require('contentful-management')
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getOrganization('<organization_id>')
        .then((organization) => organization.getUsers())
        .then((user) => console.log(user))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<User, UserProps>>

        Promise a collection of Users in organization

createOrganizationMembershipApi

  • createOrganizationMembershipApi(http: AxiosInstance, organizationId: string): { delete: any; update: any }

Const createPlainClient

  • createPlainClient(params: ClientParams, defaults?: DefaultParams): { apiKey: object; appDefinition: object; appInstallation: object; asset: object; contentType: object; editorInterface: object; entry: object; environment: object; environmentAlias: object; extension: object; locale: object; organization: object; organizationInvitation: object; organizationMembership: object; personalAccessToken: object; previewApiKey: object; raw: object; role: object; scheduledActions: object; snapshot: object; space: object; spaceMember: object; spaceMembership: object; tag: object; team: object; teamMembership: object; teamSpaceMembership: object; upload: object; usage: object; user: object; webhook: object }
  • Parameters

    Returns { apiKey: object; appDefinition: object; appInstallation: object; asset: object; contentType: object; editorInterface: object; entry: object; environment: object; environmentAlias: object; extension: object; locale: object; organization: object; organizationInvitation: object; organizationMembership: object; personalAccessToken: object; previewApiKey: object; raw: object; role: object; scheduledActions: object; snapshot: object; space: object; spaceMember: object; spaceMembership: object; tag: object; team: object; teamMembership: object; teamSpaceMembership: object; upload: object; usage: object; user: object; webhook: object }

    • apiKey: object
      • create: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • appDefinition: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • appInstallation: object
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • upsert: (Anonymous function)
    • asset: object
      • archive: (Anonymous function)
      • create: (Anonymous function)
      • createFromFiles: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • processForAllLocales: (Anonymous function)
      • processForLocale: (Anonymous function)
      • publish: (Anonymous function)
      • unarchive: (Anonymous function)
      • unpublish: (Anonymous function)
      • update: (Anonymous function)
    • contentType: object
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • omitAndDeleteField: (Anonymous function)
      • publish: (Anonymous function)
      • unpublish: (Anonymous function)
      • update: (Anonymous function)
    • editorInterface: object
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • entry: object
      • archive: Object
      • create: Object
      • createWithId: Object
      • delete: (Anonymous function)
      • get: Object
      • getMany: Object
      • publish: Object
      • unarchive: Object
      • unpublish: Object
      • update: Object
    • environment: object
      • create: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • environmentAlias: object
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • extension: object
      • create: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • locale: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • organization: object
      • get: (Anonymous function)
      • getAll: (Anonymous function)
    • organizationInvitation: object
      • create: (Anonymous function)
      • get: (Anonymous function)
    • organizationMembership: object
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • personalAccessToken: object
    • previewApiKey: object
      • get: (Anonymous function)
      • getMany: (Anonymous function)
    • raw: object
    • role: object
      • create: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • scheduledActions: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • getMany: (Anonymous function)
    • snapshot: object
      • getForContentType: (Anonymous function)
      • getForEntry: Object
      • getManyForContentType: (Anonymous function)
      • getManyForEntry: Object
    • space: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • spaceMember: object
      • get: (Anonymous function)
      • getMany: (Anonymous function)
    • spaceMembership: object
      • create: (Anonymous function)
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getForOrganization: (Anonymous function)
      • getMany: (Anonymous function)
      • getManyForOrganization: (Anonymous function)
      • update: (Anonymous function)
    • tag: object
      • createWithId: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • team: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getMany: (Anonymous function)
      • update: (Anonymous function)
    • teamMembership: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getManyForOrganization: (Anonymous function)
      • getManyForTeam: (Anonymous function)
      • update: (Anonymous function)
    • teamSpaceMembership: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getForOrganization: (Anonymous function)
      • getMany: (Anonymous function)
      • getManyForOrganization: (Anonymous function)
      • update: (Anonymous function)
    • upload: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
    • usage: object
      • getManyForOrganization: (Anonymous function)
      • getManyForSpace: (Anonymous function)
    • user: object
      • getCurrent: (Anonymous function)
      • getForOrganization: (Anonymous function)
      • getForSpace: (Anonymous function)
      • getManyForOrganization: (Anonymous function)
      • getManyForSpace: (Anonymous function)
    • webhook: object
      • create: (Anonymous function)
      • delete: (Anonymous function)
      • get: (Anonymous function)
      • getCallDetails: (Anonymous function)
      • getHealthStatus: (Anonymous function)
      • getMany: (Anonymous function)
      • getManyCallDetails: (Anonymous function)
      • update: (Anonymous function)

createPreviewApiKeyApi

  • createPreviewApiKeyApi(): {}

createRoleApi

  • createRoleApi(http: AxiosInstance): { delete: any; update: any }

createScheduledActionApi

createSnapshotApi

  • createSnapshotApi(): {}

createSpaceApi

  • createSpaceApi(__namedParameters: { http: AxiosInstance }): { createApiKey: any; createApiKeyWithId: any; createEnvironment: any; createEnvironmentAliasWithId: any; createEnvironmentWithId: any; createRole: any; createRoleWithId: any; createScheduledAction: any; createSpaceMembership: any; createSpaceMembershipWithId: any; createTeamSpaceMembership: any; createWebhook: any; createWebhookWithId: any; delete: any; getApiKey: any; getApiKeys: any; getEnvironment: any; getEnvironmentAlias: any; getEnvironmentAliases: any; getEnvironments: any; getPreviewApiKey: any; getPreviewApiKeys: any; getRole: any; getRoles: any; getScheduledActions: any; getSpaceMember: any; getSpaceMembers: any; getSpaceMembership: any; getSpaceMemberships: any; getSpaceUser: any; getSpaceUsers: any; getTeamSpaceMembership: any; getTeamSpaceMemberships: any; getWebhook: any; getWebhooks: any; update: any }
  • Creates API object with methods to access the Space API

    prop

    {object} http - HTTP client instance

    prop

    {object} entities - Object with wrapper methods for each kind of entity

    Parameters

    • __namedParameters: { http: AxiosInstance }
      • http: AxiosInstance

    Returns { createApiKey: any; createApiKeyWithId: any; createEnvironment: any; createEnvironmentAliasWithId: any; createEnvironmentWithId: any; createRole: any; createRoleWithId: any; createScheduledAction: any; createSpaceMembership: any; createSpaceMembershipWithId: any; createTeamSpaceMembership: any; createWebhook: any; createWebhookWithId: any; delete: any; getApiKey: any; getApiKeys: any; getEnvironment: any; getEnvironmentAlias: any; getEnvironmentAliases: any; getEnvironments: any; getPreviewApiKey: any; getPreviewApiKeys: any; getRole: any; getRoles: any; getScheduledActions: any; getSpaceMember: any; getSpaceMembers: any; getSpaceMembership: any; getSpaceMemberships: any; getSpaceUser: any; getSpaceUsers: any; getTeamSpaceMembership: any; getTeamSpaceMemberships: any; getWebhook: any; getWebhooks: any; update: any }

    • createApiKey: function
      • Creates a Api Key

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createApiKey({
          name: 'API Key name',
          environments:[
           {
            sys: {
             type: 'Link'
             linkType: 'Environment',
             id:'<environment_id>'
            }
           }
          ]
          }
        }))
        .then((apiKey) => console.log(apiKey))
        .catch(console.error)

        Parameters

        Returns Promise<ApiKey>

        Promise for the newly created Api Key

    • createApiKeyWithId: function
      • Creates a Api Key with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createApiKeyWithId('<api-key-id>', {
          name: 'API Key name'
          environments:[
           {
            sys: {
             type: 'Link'
             linkType: 'Environment',
             id:'<environment_id>'
            }
           }
          ]
          }
        }))
        .then((apiKey) => console.log(apiKey))
        .catch(console.error)

        Parameters

        • id: string

          Api Key ID

        • payload: CreateApiKeyProps

          Object representation of the Api Key to be created

        Returns Promise<ApiKey>

        Promise for the newly created Api Key

    • createEnvironment: function
      • Creates an Environement

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createEnvironment({ name: 'Staging' }))
        .then((environment) => console.log(environment))
        .catch(console.error)

        Parameters

        Returns Promise<Environment>

        Promise for the newly created Environment

    • createEnvironmentAliasWithId: function
      • Creates an EnvironmentAlias with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createEnvironmentAliasWithId('<environment-alias-id>', {
          environment: {
            sys: { type: 'Link', linkType: 'Environment', id: 'targetEnvironment' }
          }
        }))
        .then((environmentAlias) => console.log(environmentAlias))
        .catch(console.error)

        Parameters

        • environmentAliasId: string

          EnvironmentAlias ID

        • data: CreateEnvironmentAliasProps

          Object representation of the EnvironmentAlias to be created

        Returns Promise<EnvironmentAlias>

        Promise for the newly created EnvironmentAlias

    • createEnvironmentWithId: function
      • Creates an Environment with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createEnvironmentWithId('<environment-id>', { name: 'Staging'}, 'master'))
        .then((environment) => console.log(environment))
        .catch(console.error)

        Parameters

        • id: string

          Environment ID

        • data: CreateEnvironmentProps

          Object representation of the Environment to be created

        • Optional sourceEnvironmentId: undefined | string

          ID of the source environment that will be copied to create the new environment. Default is "master"

        Returns Promise<Environment>

        Promise for the newly created Environment

    • createRole: function
      • Creates a Role

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        client.getSpace('<space_id>')
        .then((space) => space.createRole({
          name: 'My Role',
          description: 'foobar role',
          permissions: {
            ContentDelivery: 'all',
            ContentModel: ['read'],
            Settings: []
          },
          policies: [
            {
              effect: 'allow',
              actions: 'all',
              constraint: {
                and: [
                  {
                    equals: [
                      { doc: 'sys.type' },
                      'Entry'
                    ]
                  },
                  {
                    equals: [
                      { doc: 'sys.type' },
                      'Asset'
                    ]
                  }
                ]
              }
            }
          ]
        }))
        .then((role) => console.log(role))
        .catch(console.error)

        Parameters

        Returns Promise<Role>

        Promise for the newly created Role

    • createRoleWithId: function
      • createRoleWithId(id: string, roleData: Omit<RoleProps, "sys">): Promise<Role>
      • Creates a Role with a custom ID

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        client.getSpace('<space_id>')
        .then((space) => space.createRoleWithId('<role-id>', {
          name: 'My Role',
          description: 'foobar role',
          permissions: {
            ContentDelivery: 'all',
            ContentModel: ['read'],
            Settings: []
          },
          policies: [
            {
              effect: 'allow',
              actions: 'all',
              constraint: {
                and: [
                  {
                    equals: [
                      { doc: 'sys.type' },
                      'Entry'
                    ]
                  },
                  {
                    equals: [
                      { doc: 'sys.type' },
                      'Asset'
                    ]
                  }
                ]
              }
            }
          ]
        }))
        .then((role) => console.log(role))
        .catch(console.error)

        Parameters

        • id: string

          Role ID

        • roleData: Omit<RoleProps, "sys">

        Returns Promise<Role>

        Promise for the newly created Role

    • createScheduledAction: function
    • createSpaceMembership: function
      • Creates a Space Membership Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createSpaceMembership({
          admin: false,
          roles: [
            {
              type: 'Link',
              linkType: 'Role',
              id: '<role_id>'
            }
          ],
          email: 'foo@example.com'
        }))
        .then((spaceMembership) => console.log(spaceMembership))
        .catch(console.error)

        Parameters

        Returns Promise<SpaceMembership>

        Promise for the newly created Space Membership

    • createSpaceMembershipWithId: function
      • Creates a Space Membership with a custom ID Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createSpaceMembershipWithId('<space-membership-id>', {
          admin: false,
          roles: [
            {
              type: 'Link',
              linkType: 'Role',
              id: '<role_id>'
            }
          ],
          email: 'foo@example.com'
        }))
        .then((spaceMembership) => console.log(spaceMembership))
        .catch(console.error)

        Parameters

        Returns Promise<SpaceMembership>

        Promise for the newly created Space Membership

    • createTeamSpaceMembership: function
      • Creates a Team Space Membership

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createTeamSpaceMembership('team_id', {
          admin: false,
          roles: [
           {
        sys: {
              type: 'Link',
              linkType: 'Role',
              id: '<role_id>'
             }
           }
          ],
        }))
        .then((teamSpaceMembership) => console.log(teamSpaceMembership))
        .catch(console.error)

        Parameters

        Returns Promise<TeamSpaceMembership>

        Promise for the newly created Team Space Membership

    • createWebhook: function
      • Creates a Webhook

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.createWebhook({
          'name': 'My webhook',
          'url': 'https://www.example.com/test',
          'topics': [
            'Entry.create',
            'ContentType.create',
            '*.publish',
            'Asset.*'
          ]
        }))
        .then((webhook) => console.log(webhook))
        .catch(console.error)

        Parameters

        Returns Promise<WebHooks>

        Promise for the newly created Webhook

    • createWebhookWithId: function
      • Creates a Webhook with a custom ID

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.createWebhookWithId('<webhook_id>', {
          'name': 'My webhook',
          'url': 'https://www.example.com/test',
          'topics': [
            'Entry.create',
            'ContentType.create',
            '*.publish',
            'Asset.*'
          ]
        }))
        .then((webhook) => console.log(webhook))
        .catch(console.error)

        Parameters

        • id: string

          Webhook ID

        • data: CreateWebhooksProps

          Object representation of the Webhook to be created

        Returns Promise<WebHooks>

        Promise for the newly created Webhook

    • delete: function
      • delete(): Promise<any>
      • Deletes the space

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
          .then((space) => space.delete())
          .then(() => console.log('Space deleted.'))
          .catch(console.error)

        Returns Promise<any>

        Promise for the deletion. It contains no data, but the Promise error case should be handled.

    • getApiKey: function
      • getApiKey(id: string): Promise<ApiKey>
      • Gets a Api Key

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getApiKey('<apikey-id>'))
        .then((apikey) => console.log(apikey))
        .catch(console.error)

        Parameters

        • id: string

          API Key ID

        Returns Promise<ApiKey>

        Promise for a Api Key

    • getApiKeys: function
      • Gets a collection of Api Keys

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getApiKeys())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<ApiKey, ApiKeyProps>>

        Promise for a collection of Api Keys

    • getEnvironment: function
      • getEnvironment(environmentId: string): Promise<Environment>
      • Gets an environment

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironment('<environement_id>'))
        .then((environment) => console.log(environment))
        .catch(console.error)

        Parameters

        • environmentId: string

        Returns Promise<Environment>

        Promise for an Environment

    • getEnvironmentAlias: function
      • Gets an Environment Alias

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironmentAlias('<alias-id>'))
        .then((alias) => console.log(alias))
        .catch(console.error)

        Parameters

        • environmentAliasId: string

        Returns Promise<EnvironmentAlias>

        Promise for an Environment Alias

    • getEnvironmentAliases: function
      • Gets a collection of Environment Aliases

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironmentAliases()
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<EnvironmentAlias, EnvironmentAliasProps>>

        Promise for a collection of Environment Aliases

    • getEnvironments: function
      • Gets a collection of Environments

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getEnvironments())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<Environment, EnvironmentProps>>

        Promise for a collection of Environment

    • getPreviewApiKey: function
      • Gets a preview Api Key

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getPreviewApiKey('<preview-apikey-id>'))
        .then((previewApikey) => console.log(previewApikey))
        .catch(console.error)

        Parameters

        • id: string

          Preview API Key ID

        Returns Promise<PreviewApiKey>

        Promise for a Preview Api Key

    • getPreviewApiKeys: function
      • Gets a collection of preview Api Keys

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getPreviewApiKeys())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<PreviewApiKey, PreviewApiKeyProps>>

        Promise for a collection of Preview Api Keys

    • getRole: function
      • getRole(id: string): Promise<Role>
      • Gets a Role

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.createRole({
          fields: {
            title: {
              'en-US': 'Role title'
            }
          }
        }))
        .then((role) => console.log(role))
        .catch(console.error)

        Parameters

        • id: string

          Role ID

        Returns Promise<Role>

        Promise for a Role

    • getRoles: function
      • Gets a collection of Roles

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getRoles())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<Role, RoleProps>>

        Promise for a collection of Roles

    • getScheduledActions: function
    • getSpaceMember: function
      • getSpaceMember(id: string): Promise<SpaceMemberProps & { toPlainObject: any }>
      • Gets a Space Member

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceMember(id))
        .then((spaceMember) => console.log(spaceMember))
        .catch(console.error)

        Parameters

        • id: string

          Get Space Member by user_id

        Returns Promise<SpaceMemberProps & { toPlainObject: any }>

        Promise for a Space Member

    • getSpaceMembers: function
      • Gets a collection of Space Members

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceMembers({'limit': 100}))
        .then((spaceMemberCollection) => console.log(spaceMemberCollection))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<SpaceMemberProps & { toPlainObject: any }, SpaceMemberProps>>

        Promise for a collection of Space Members

    • getSpaceMembership: function
      • Gets a Space Membership Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceMembership('id'))
        .then((spaceMembership) => console.log(spaceMembership))
        .catch(console.error)

        Parameters

        • id: string

          Space Membership ID

        Returns Promise<SpaceMembership>

        Promise for a Space Membership

    • getSpaceMemberships: function
      • Gets a collection of Space Memberships Warning: the user attribute in the space membership root is deprecated. The attribute has been moved inside the sys object (i.e. sys.user).

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
        .then((response) => console.log(response.items))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<SpaceMembership, SpaceMembershipProps>>

        Promise for a collection of Space Memberships

    • getSpaceUser: function
      • getSpaceUser(userId: string): Promise<User>
      • Gets a User

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceUser('id'))
        .then((user) => console.log(user))
        .catch(console.error)

        Parameters

        • userId: string

          User ID

        Returns Promise<User>

        Promise for a User

    • getSpaceUsers: function
      • Gets a collection of Users in a space

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getSpaceUsers(query))
        .then((data) => console.log(data))
        .catch(console.error)

        Parameters

        Returns Promise<Collection<User, UserProps>>

        Promise a collection of Users in a space

    • getTeamSpaceMembership: function
      • Gets a Team Space Membership

        example
        const contentful = require('contentful-management')
        
        client.getSpace('<space_id>')
        .then((space) => space.getTeamSpaceMembership('team_space_membership_id'))
        .then((teamSpaceMembership) => console.log(teamSpaceMembership))
        .catch(console.error)

        Parameters

        • teamSpaceMembershipId: string

        Returns Promise<TeamSpaceMembership>

        Promise for a Team Space Membership

    • getTeamSpaceMemberships: function
    • getWebhook: function
      • getWebhook(id: string): Promise<WebHooks>
      • Gets a Webhook

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getWebhook('<webhook_id>'))
        .then((webhook) => console.log(webhook))
        .catch(console.error)

        Parameters

        • id: string

          Webhook ID

        Returns Promise<WebHooks>

        Promise for a Webhook

    • getWebhooks: function
      • Gets a collection of Webhooks

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => space.getWebhooks())
        .then((response) => console.log(response.items))
        .catch(console.error)

        Returns Promise<Collection<WebHooks, WebhookProps>>

        Promise for a collection of Webhooks

    • update: function
      • update(): Promise<Space>
      • Updates the space

        example
        const contentful = require('contentful-management')
        
        const client = contentful.createClient({
          accessToken: '<content_management_api_key>'
        })
        
        client.getSpace('<space_id>')
        .then((space) => {
          space.name = 'New name'
          return space.update()
        })
        .then((space) => console.log(`Space ${space.sys.id} renamed.`)
        .catch(console.error)

        Returns Promise<Space>

        Promise for the updated space.

createSpaceMembershipApi

  • createSpaceMembershipApi(http: AxiosInstance): { delete: any; update: any }

createTagApi

  • createTagApi(http: AxiosInstance): TagApi

createTeamMembershipApi

  • createTeamMembershipApi(http: AxiosInstance): { delete: any; update: any }

createTeamSpaceMembershipApi

  • createTeamSpaceMembershipApi(http: AxiosInstance): { delete: any; update: any }

createUiExtensionApi

  • createUiExtensionApi(http: AxiosInstance): { delete: any; update: any }

createUploadApi

  • createUploadApi(http: AxiosInstance): { delete: any }

createWebhookApi

  • createWebhookApi(http: AxiosInstance): { delete: any; getCall: any; getCalls: any; getHealth: any; update: any }

Const createWithId

Const del

Const get

Const getAll

Const getAppDefinitionUrl

Const getAppInstallationUrl

Const getBaseContentTypeUrl

Const getBaseEntryUrl

Const getBaseUrl

Const getCallDetails

Const getContentTypeUrl

Const getCurrent

  • getCurrent(http: AxiosInstance): Promise<UserProps>

Const getEntityUrl

Const getEntryUrl

Const getEnvironmentAliasUrl

Const getForContentType

Const getForEntry

Const getForOrganization

Const getForSpace

Const getHealthStatus

Const getMany

Const getManyCallDetails

Const getManyForContentType

Const getManyForEntry

Const getManyForOrganization

Const getManyForSpace

Const getManyForTeam

Const getTagUrl

Const getUIExtensionUrl

Const getWebhookCallBaseUrl

Const getWebhookCallDetailsUrl

Const getWebhookCallUrl

Const getWebhookHealthUrl

Const getWebhookUrl

http

  • http<T>(http: AxiosInstance, url: string, config?: AxiosRequestConfig): Promise<any>
  • Type parameters

    • T

    Parameters

    • http: AxiosInstance
    • url: string
    • Optional config: AxiosRequestConfig

    Returns Promise<any>

Const isArchived

Const isDraft

Const isPublished

Const isUpdated

normalizeSelect

Const omitAndDeleteField

post

  • post<T>(http: AxiosInstance, url: string, payload?: any, config?: AxiosRequestConfig): Promise<T>
  • Type parameters

    • T

    Parameters

    • http: AxiosInstance
    • url: string
    • Optional payload: any
    • Optional config: AxiosRequestConfig

    Returns Promise<T>

processForAllLocales

processForLocale

  • processForLocale(http: AxiosInstance, params: GetSpaceEnvironmentParams, asset: AssetProps, locale: string, __namedParameters?: { processingCheckRetries: undefined | number; processingCheckWait: undefined | number }): Promise<AssetProps>

Const publish

put

  • put<T>(http: AxiosInstance, url: string, payload?: any, config?: AxiosRequestConfig): Promise<T>
  • Type parameters

    • T

    Parameters

    • http: AxiosInstance
    • url: string
    • Optional payload: any
    • Optional config: AxiosRequestConfig

    Returns Promise<T>

Const revoke

spaceMembershipDeprecationWarning

  • spaceMembershipDeprecationWarning(): void

Const unarchive

Const unpublish

Const update

Const upsert

Const withDefaults

  • withDefaults<T, P, R, D>(defaults: D | undefined, fn: (params: P, ...rest: T) => R): (Anonymous function)
  • Type parameters

    • T: any[]

    • P: {}

    • R

    • D

    Parameters

    • defaults: D | undefined
    • fn: (params: P, ...rest: T) => R
        • (params: P, ...rest: T): R
        • Parameters

          • params: P
          • Rest ...rest: T

          Returns R

    Returns (Anonymous function)

Const withHttp

  • withHttp<T, P, R, A>(http: AxiosInstance, fn: EndpointDefinition<T, P, R>): (Anonymous function)

Const wrap

Const wrapCollection

  • wrapCollection<R, T, Rest>(fn: (http: AxiosInstance, entity: T, ...rest: Rest) => R): (Anonymous function)
  • Type parameters

    • R

    • T

    • Rest: any[]

    Parameters

    • fn: (http: AxiosInstance, entity: T, ...rest: Rest) => R
        • (http: AxiosInstance, entity: T, ...rest: Rest): R
        • Parameters

          • http: AxiosInstance
          • entity: T
          • Rest ...rest: Rest

          Returns R

    Returns (Anonymous function)

Const wrapHttp

  • wrapHttp<R>(http: AxiosInstance, fn: EndpointWithHttp<R>): (Anonymous function)

wrapScheduledAction

wrapTag

Object literals

Const InvitationAlphaHeaders

InvitationAlphaHeaders: object

x-contentful-enable-alpha-feature

x-contentful-enable-alpha-feature: string = "pending-org-membership"

Const OrganizationUserManagementAlphaHeaders

OrganizationUserManagementAlphaHeaders: object

x-contentful-enable-alpha-feature

x-contentful-enable-alpha-feature: string = "organization-user-management-api"

Const defaultHostParameters

defaultHostParameters: object

defaultHostname

defaultHostname: string = "api.contentful.com"

defaultHostnameUpload

defaultHostnameUpload: string = "upload.contentful.com"